def upsample_leaf
stelliferous@0.0.2.0 · tensor_layout.bend:172
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
import stelliferous@0.0.2.0/tensor_band.bend as Bands
import stelliferous@0.0.2.0/traversal_partition.bend as Partition
172def upsample_leaf(~Element: Data,context: Upsample<Element>,first: U32,rows: U32,input: Storage.Buffer<Element>) -> Bands.Bands(~Element):
173 Upsample{Bands.Geometry{batch,channels,height,width},+scale,fill} = context
174 +rows = rows
175 +shape = {[channels,rows,width] : List<&2,U32>}
176 +first = (first * scale : U32)
177 +rows = (rows * scale : U32)
178 Tensors.with_dense(~Element,~Bands.Bands(~Element),
179 result_of(~Element,upsample_view(~Element,repeated(Tensors.view_of(shape),scale),Tensors.Usable{},input,shape,scale,fill,1)),
180 output => shape => fill => status => workers => Partition.Leaf{output,first,rows,Unit{}})