TensorShape.padded: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_shape.bend as TensorShape Lines 100-107 of stelliferous@0.0.2.0/tensor_shape.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_shape.bend&start_line=100&end_line=107 import Base # Each extent with before elements added in front and after elements behind. # The three lists have one entry per axis and no sum may wrap. def padded(extents: List<&2,U32>,before: List<&2,U32>,after: List<&2,U32>) -> Maybe<&2,List<&2,U32>>: match extents before after: case Nil{} Nil{} Nil{}: Some{[]} case Con{extent,extents} Con{front,before} Con{back,after}: prepend_extent(checked_add_to(checked_add(front,extent),back),padded(extents,before,after)) case extents before after: None{} Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe 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_shape.bend&name=checked_add https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_shape.bend&name=checked_add_to https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_shape.bend&name=prepend_extent