Function mean

  • Calculates the mean of elements across dimensions of a tensor.

    Parameters

    • t: Tensor

      the input tensor

    • Optional axis: number | number[]

      (optional) the dimension(s) to reduce. By default it reduces all dimensions.

    • Optional keepDims: boolean

      (optional) if true, retains reduced dimensions with size 1.

    Returns Tensor

    the mean