TensorF32.mean_axis: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_f32.bend as TensorF32 Lines 392-396 of stelliferous@0.0.2.0/tensor_f32.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_f32.bend&start_line=392&end_line=396 import Base import stelliferous@0.0.2.0/tensor.bend as Tensors import stelliferous@0.0.2.0/tensor_layout.bend as Layout # sum_axis divided by the extent of the axis. def mean_axis(tensor: Tensor(),+axis: U32) -> Tensor(): then_shape(shape(tensor),tensor => extents => Tensors.combine_scalar(~F32,~F32.div,"mean_axis",1.0,Layout.reduce_axis(~F32,~F32.add,"mean_axis",0.0,tensor,axis), U32.to_f32(Layout.extent_at(extents,U32.to_nat(axis))))) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_f32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=combine_scalar https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_f32.bend&name=Tensor https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_f32.bend&name=shape https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_f32.bend&name=then_shape https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_layout.bend&name=extent_at https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_layout.bend&name=reduce_axis