def mean_axis

stelliferous@0.0.2.0 · tensor_f32.bend:392

import stelliferous@0.0.2.0/tensor_f32.bend as TensorF32
import Base
import stelliferous@0.0.2.0/tensor.bend as Tensors
import stelliferous@0.0.2.0/tensor_layout.bend as Layout

392# sum_axis divided by the extent of the axis.
393def mean_axis(tensor: Tensor(),+axis: U32) -> Tensor():
394  then_shape(shape(tensor),tensor => extents =>
395    Tensors.combine_scalar(~F32,~F32.div,"mean_axis",1.0,Layout.reduce_axis(~F32,~F32.add,"mean_axis",0.0,tensor,axis),
396      U32.to_f32(Layout.extent_at(extents,U32.to_nat(axis)))))

Uses (12)

Used by (0)

No other definition uses this definition.