def pad

stelliferous@0.0.2.0 · tensor_layout.bend:559

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

559# before[i] elements are added in front of axis i and after[i] behind it. Both
560# lists have one entry per axis and the padded extents must be allocatable.
561def pad(~Element: Data,+border: Border<Element>,tensor: Tensors.Tensor<Element>,+before: List<&2,U32>,+after: List<&2,U32>) -> Tensors.Tensor<Element>:
562  Tensors.with_metadata(~Element,~Tensors.Tensor<Element>,tensor,tensor => shape => fill => status => workers =>
563    +shape = shape
564    +padded = Shapes.padded(shape,before,after)
565    pad_valid(~Element,border,status,Views.has_count(padded_count(padded)),tensor,shape,before,after,padded))

Uses (9)

Used by (2)