Tensor.combine_stretched_with: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor.bend as Tensor Lines 291-304 of stelliferous@0.0.2.0/tensor.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor.bend&start_line=291&end_line=304 import Base import stelliferous@0.0.2.0/storage_buffer.bend as Storage import stelliferous@0.0.2.0/tensor_view.bend as Views # Operands of different extents with the common extents shape. When shape is # the left extents, only the right operand is stretched and the result reuses # the left storage. Otherwise the left operand is first copied through its # stretched view into new storage, which the right operand is combined into; # both steps run the innermost axis as one loop, which the three-buffer # combination with two cursors does not. def combine_stretched_with(~Element: Data,~kernel: @+count: Nat -> @+right_view: Views.View -> @+offset: U32 -> Storage.Buffer -> Storage.Buffer -> Storage.Buffer & Storage.Buffer,name: String,in_place: Bool, left: Storage.Buffer,+left_shape: List<&2,U32>,+fill: Element,right: Storage.Buffer,+right_shape: List<&2,U32>,+shape: List<&2,U32>,+workers: U32) -> Tensor: match in_place: case True{}: combine_views_with(~Element,~kernel,name,view_of(left_shape),stretched(view_of(right_shape),left_shape),left,left_shape,fill,right,right_shape,workers) case False{}: combine_fresh_views_with(~Element,~kernel,name,stretched(view_of(left_shape),shape),stretched(view_of(right_shape),shape),view_of(shape),view_of(shape),count_of(shape), left,right,shape,fill,workers) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/storage_buffer.bend&name=Buffer 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=combine_fresh_views_with https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=combine_views_with https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=count_of https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=stretched https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=view_of https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_view.bend&name=View