def upsample_bands
stelliferous@0.0.2.0 · tensor_layout.bend:195
import stelliferous@0.0.2.0/tensor_layout.bend as TensorLayout
import Base
import stelliferous@0.0.2.0/tensor_shape.bend as Shapes
import stelliferous@0.0.2.0/tensor_view.bend as Views
import stelliferous@0.0.2.0/tensor.bend as Tensors
import stelliferous@0.0.2.0/tensor_band.bend as Bands
195def upsample_bands(~Element: Data,status: Tensors.Status,bands: Bands.Bands(~Element),geometry: Bands.Geometry,+shape: List<&2,U32>,+scale: U32,
196 +fill: Element,workers: U32) -> Tensors.Tensor<Element>:
197 match status geometry:
198 case Tensors.Failed{+problem} geometry:
199 Tensors.with_dense(~Element,~Tensors.Tensor<Element>,Tensors.Banded{bands,geometry,shape,fill,Tensors.Failed{problem},workers},
200 storage => shape => fill => status => workers =>
201 +shape = shape
202 result_of(~Element,upsample_view(~Element,repeated(Tensors.view_of(shape),scale),status,storage,shape,scale,fill,workers)))
203 case Tensors.Usable{} Bands.Geometry{batch,channels,+height,+width}:
204 upsample_supported(~Element,Bool.not(U32.is_zero(scale)) && Views.has_count(Shapes.checked_multiply(height,scale)) &&
205 Views.has_count(Shapes.checked_multiply(width,scale)) && Views.has_count(Tensors.count_of(scaled_extents(shape,scale))) &&
206 Bool.not(Shapes.has_zero(scaled_extents(shape,scale))),
207 bands,Bands.Geometry{batch,channels,height,width},shape,scale,fill,workers)