Elementwise.same_left: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise Lines 266-276 of bendtorch-core@0.1.0.0/src/tensor/elementwise.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&start_line=266&end_line=276 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape # Whether the left input's stride is the output's on every axis and the last # one is 1, so that the walk of every position is the position itself. Equal # left and output shapes with no axis of extent 1 have such rows. def same_left(rows: List<&2, Shape.Row>) -> Bool: match rows: case Shape.Row{+stride, +left, right} <> Nil{}: Bool.and(Nat.is_eq(stride, 1n), Nat.is_eq(left, 1n)) case Shape.Row{+stride, +left, right} <> rest: Bool.and(Nat.is_eq(left, stride), same_left(rest)) case Nil{}: False{} Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_eq https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Row