Function average

  • Calculates the weighted average of elements.

    Parameters

    • t: Tensor

      the input tensor

    • Optional w: Tensor

      (optional) the weights for each element

    Returns Tensor

    the weighted average