def combined_fresh_with

stelliferous@0.0.2.0 · tensor.bend:270

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_view.bend as Views
import stelliferous@0.0.2.0/tensor_operations.bend as Operations

270# The left operand was copied through its stretched view into new storage of
271# the common extents; the right operand is then combined into that storage.
272# The view of that storage is built once for each of the two steps: using one
273# view value twice would make the compiler share every View constructor.
274def combined_fresh_with(~Element: Data,~kernel: @+count: Nat -> @+right_view: Views.View -> @+offset: U32 -> Storage.Buffer<Element> -> Storage.Buffer<Element> -> Storage.Buffer<Element> & Storage.Buffer<Element>,name: String,+shape: List<&2,U32>,+fill: Element,+workers: U32,
275  right: Storage.Buffer<Element>,right_view: Views.View,target: Views.View,
276  copied: Operations.Outcome<(Storage.Buffer<Element> & Storage.Buffer<Element>)>) -> Tensor<Element>:
277  match copied:
278    case Operations.Accepted{(left,output)}:
279      combined(~Element,name,shape,shape,fill,workers,Operations.combine_with(~Element,~kernel,output,target,right,right_view))
280    case Operations.Rejected{(left,output)}: Tensor{output,shape,fill,Failed{Problem{name,InvalidShape{shape}}},workers}

Uses (15)

Used by (1)