def fold_step

stelliferous@0.0.2.0 · tensor_layout.bend:421

import stelliferous@0.0.2.0/tensor_layout.bend as TensorLayout
import Base
import stelliferous@0.0.2.0/storage_buffer.bend as Storage
import stelliferous@0.0.2.0/tensor.bend as Tensors

421# The views are built from the extents at every step: a loop that carried one
422# View value through its iterations would make the compiler share every View
423# constructor of the program.
424def fold_step(~Element: Data,~operation: Element -> Element -> Element,index: U32,axis: U32,shape: List<&2,U32>,unit: List<&2,U32>,
425  state: (Storage.Buffer<Element> & Storage.Buffer<Element>) & Bool) -> (Storage.Buffer<Element> & Storage.Buffer<Element>) & Bool:
426  (owners,valid) = state
427  (output,input) = owners
428  fold_slice(~Element,~operation,valid,sliced(Tensors.view_of(shape),axis,index,1,1),Tensors.view_of(unit),output,input)

Uses (9)

Used by (1)