def indexed

stelliferous@0.0.2.0 · tensor.bend:428

import stelliferous@0.0.2.0/tensor.bend as Tensor
import Base
import stelliferous@0.0.2.0/storage_buffer.bend as Storage
import stelliferous@0.0.2.0/tensor_operations.bend as Operations

428# The function also receives each element's row-major index.
429def indexed(~Element: Data,+shape: List<&2,U32>,+fill: Element,+workers: U32,result: Operations.Outcome<(Storage.Buffer<Element> & Storage.Buffer<Element>)>) -> Tensor<Element>:
430  match result:
431    case Operations.Accepted{(input,output)}: Tensor{output,shape,fill,Usable{},workers}
432    case Operations.Rejected{(input,output)}: Tensor{input,shape,fill,Failed{Problem{"apply_indexed",InvalidShape{shape}}},workers}

Uses (10)

Used by (1)