TensorPrimitives.IndexOfMaxMagnitude Method

Definition

Overloads

IndexOfMaxMagnitude(ReadOnlySpan<Single>)

Searches for the index of the single-precision floating-point number with the largest magnitude in the specified tensor.

IndexOfMaxMagnitude<T>(ReadOnlySpan<T>)

Searches for the index of the number with the largest magnitude in the specified tensor.

IndexOfMaxMagnitude(ReadOnlySpan<Single>)

Source:
TensorPrimitives.cs
Source:
TensorPrimitives.Single.cs
Source:
TensorPrimitives.Single.cs

Searches for the index of the single-precision floating-point number with the largest magnitude in the specified tensor.

public:
 static int IndexOfMaxMagnitude(ReadOnlySpan<float> x);
public static int IndexOfMaxMagnitude (ReadOnlySpan<float> x);
static member IndexOfMaxMagnitude : ReadOnlySpan<single> -> int
Public Shared Function IndexOfMaxMagnitude (x As ReadOnlySpan(Of Single)) As Integer

Parameters

x
ReadOnlySpan<Single>

The tensor, represented as a span.

Returns

The index of the element in x with the largest magnitude (absolute value), or -1 if x is empty.

Remarks

The determination of the maximum magnitude matches the IEEE 754:2019 `maximumMagnitude` function. If any value equal to NaN is present, the index of the first is returned. If two values have the same magnitude and one is positive and the other is negative, the positive value is considered to have the larger magnitude.

This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different operating systems or architectures.

Applies to

IndexOfMaxMagnitude<T>(ReadOnlySpan<T>)

Source:
TensorPrimitives.IndexOfMaxMagnitude.cs
Source:
TensorPrimitives.IndexOfMaxMagnitude.cs

Searches for the index of the number with the largest magnitude in the specified tensor.

public:
generic <typename T>
 where T : System::Numerics::INumber<T> static int IndexOfMaxMagnitude(ReadOnlySpan<T> x);
public static int IndexOfMaxMagnitude<T> (ReadOnlySpan<T> x) where T : System.Numerics.INumber<T>;
static member IndexOfMaxMagnitude : ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> -> int (requires 'T :> System.Numerics.INumber<'T>)
Public Shared Function IndexOfMaxMagnitude(Of T As INumber(Of T)) (x As ReadOnlySpan(Of T)) As Integer

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The tensor, represented as a span.

Returns

The index of the element in x with the largest magnitude (absolute value), or -1 if x is empty.

Remarks

The determination of the maximum magnitude matches the IEEE 754:2019 `maximumMagnitude` function. If any value equal to NaN is present, the index of the first is returned. If two values have the same magnitude and one is positive and the other is negative, the positive value is considered to have the larger magnitude.

This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different operating systems or architectures.

Applies to