def broadcast_status

stelliferous@0.0.2.0 · tensor_layout.bend:399

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

399# Broadcasting to given extents: one checked copy from a stretched view.
400def broadcast_status(~Element: Data,status: Tensors.Status,view: Maybe<&2,Views.View>,storage: Storage.Buffer<Element>,+shape: List<&2,U32>,
401  +target: List<&2,U32>,+fill: Element,+workers: U32) -> Tensors.Tensor<Element>:
402  match status view:
403    case Tensors.Usable{} None{}: Tensors.failed(~Element,"broadcast_to",Tensors.ShapeMismatch{shape,target},target,fill,workers)
404    case status view: result_of(~Element,gather_status(~Element,"broadcast_to",status,view,target,target,storage,shape,fill,workers))

Uses (11)

Used by (1)