def apply_context

stelliferous@0.0.2.0 · tensor_operations.bend:146

import stelliferous@0.0.2.0/tensor_operations.bend as TensorOperations
import Base
import stelliferous@0.0.2.0/storage_buffer.bend as Storage
import stelliferous@0.0.2.0/tensor_view.bend as Views
import stelliferous@0.0.2.0/proofs/storage_certificate.bend as Certificate

146def apply_context(~Element: Data,~Context: Data,~mapper: @+count: Nat -> @+position: U32 -> @+context: Context -> Storage.Buffer<Element> -> Storage.Buffer<Element>,context: Context,buffer: Storage.Buffer<Element>,+view: Views.View) -> Outcome<Storage.Buffer<Element>>:
147  Storage.Buffer{storage,+length,certificate} = buffer
148  Certificate.Certificate{+depth,equation} = certificate
149  apply_context_when(~Element,~Context,~mapper,context,Views.is_contiguous(view) && valid_buffer(length,U32.shln(1,depth),view),Views.numel(view),view,
150    Storage.Buffer{storage,length,Certificate.Certificate{depth,equation}})

Uses (12)

Used by (1)