def set_slice

stelliferous@0.0.2.0 · tensor_layout.bend:270

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

270# target[..., start : start + part extent, ...] = part along axis: the part is
271# written through the slice of the target that it replaces.
272def set_slice(~Element: Data,target: Tensors.Tensor<Element>,+axis: U32,start: U32,part: Tensors.Tensor<Element>) -> Tensors.Tensor<Element>:
273  Tensors.with_dense(~Element,~Tensors.Tensor<Element>,target,target => target_shape => target_fill => target_status => target_workers =>
274    +target_shape = target_shape
275    Tensors.with_dense(~Element,~Tensors.Tensor<Element>,part,part => part_shape => part_fill => part_status => part_workers =>
276      +part_shape = part_shape
277      result_of(~Element,place_status(~Element,"set_slice",target_status,part_status,
278        sliced(Tensors.view_of(target_shape),axis,start,extent_at(part_shape,U32.to_nat(axis)),1),target,target_shape,target_fill,part,part_shape,part_fill,
279        U32.max(target_workers,part_workers)))))

Uses (10)

Used by (2)