1 # Rebuild source owners once after the complete read-only native traversal. 2 import Base 3 import ./kernel_parameter_gradient.bend as Kernel 4 import ./storage_buffer.bend as Storage 5 import ./proofs/parameter_gradient_certificate.bend as Certificate 6 import ./proofs/storage_certificate.bend as StorageCertificate 7 8 def bias_kept(length: Nat,result: Array & Storage.Buffer,certificate: StorageCertificate.Certificate,result)>) -> 9 Storage.Buffer & Storage.Buffer: 10 (d,values) = result 11 (Storage.Buffer{d,length,certificate},values) 12 13 # d is read; every output is written into result. 14 def bias(+work: Kernel.Work,d: Storage.Buffer,result: Storage.Buffer) -> Storage.Buffer & Storage.Buffer: 15 Storage.Buffer{d,length,certificate} = d 16 bias_kept(length,Kernel.bias(work,d,result),Certificate.bias(work,d,result,certificate))