# Rebuild source owners once after the complete read-only native traversal. import Base import ./kernel_parameter_gradient.bend as Kernel import ./storage_buffer.bend as Storage import ./proofs/parameter_gradient_certificate.bend as Certificate import ./proofs/storage_certificate.bend as StorageCertificate def bias_kept(length: Nat,result: Array & Storage.Buffer,certificate: StorageCertificate.Certificate,result)>) -> Storage.Buffer & Storage.Buffer: (d,values) = result (Storage.Buffer{d,length,certificate},values) # d is read; every output is written into result. def bias(+work: Kernel.Work,d: Storage.Buffer,result: Storage.Buffer) -> Storage.Buffer & Storage.Buffer: Storage.Buffer{d,length,certificate} = d bias_kept(length,Kernel.bias(work,d,result),Certificate.bias(work,d,result,certificate))