TensorPrimitives.Average<T>(ReadOnlySpan<T>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Computes the mean of all elements in the specified non-empty tensor of numbers.
public:
generic <typename T>
where T : System::Numerics::INumberBase<T> static T Average(ReadOnlySpan<T> x);
public static T Average<T>(ReadOnlySpan<T> x) where T : System.Numerics.INumberBase<T>;
static member Average : ReadOnlySpan<'T (requires 'T :> System.Numerics.INumberBase<'T>)> -> 'T (requires 'T :> System.Numerics.INumberBase<'T>)
Public Shared Function Average(Of T As INumberBase(Of T)) (x As ReadOnlySpan(Of T)) As T
Type Parameters
- T
Parameters
The tensor, represented as a span.
Returns
The mean of all elements in x
.
Exceptions
Length of x
must be greater than zero.
Remarks
If any of the input values is equal to NaN, the result value is also NaN.