TensorLayout.pad: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_layout.bend as TensorLayout Lines 559-565 of stelliferous@0.0.2.0/tensor_layout.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_layout.bend&start_line=559&end_line=565 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 # before[i] elements are added in front of axis i and after[i] behind it. Both # lists have one entry per axis and the padded extents must be allocatable. def pad(~Element: Data,+border: Border,tensor: Tensors.Tensor,+before: List<&2,U32>,+after: List<&2,U32>) -> Tensors.Tensor: Tensors.with_metadata(~Element,~Tensors.Tensor,tensor,tensor => shape => fill => status => workers => +shape = shape +padded = Shapes.padded(shape,before,after) pad_valid(~Element,border,status,Views.has_count(padded_count(padded)),tensor,shape,before,after,padded)) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=Tensor https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=with_metadata https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_layout.bend&name=Border https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_layout.bend&name=pad_valid https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_layout.bend&name=padded_count https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_shape.bend&name=padded https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_view.bend&name=has_count