def stretched_axis
import stelliferous@0.0.2.0/tensor_view.bend as TensorViewimport Base
211# One axis read as extent elements: unchanged when the extents agree, the
212# single element repeated (stride 0) when the axis has extent 1.
213def stretched_axis(same: Bool,single: Bool,size: U32,stride: U32,extent: U32) -> Maybe<&2,Axis>:
214 match same single:
215 case True{} single: Some{Axis{size,stride}}
216 case False{} True{}: Some{Axis{extent,0}}
217 case False{} False{}: None{}