TensorPrimitives.IndexOfMinMagnitude 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.
Overloads
IndexOfMinMagnitude(ReadOnlySpan<Single>) |
Searches for the index of the single-precision floating-point number with the smallest magnitude in the specified tensor. |
IndexOfMinMagnitude<T>(ReadOnlySpan<T>) |
Searches for the index of the number with the smallest magnitude in the specified tensor. |
IndexOfMinMagnitude(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 smallest magnitude in the specified tensor.
public:
static int IndexOfMinMagnitude(ReadOnlySpan<float> x);
public static int IndexOfMinMagnitude (ReadOnlySpan<float> x);
static member IndexOfMinMagnitude : ReadOnlySpan<single> -> int
Public Shared Function IndexOfMinMagnitude (x As ReadOnlySpan(Of Single)) As Integer
Parameters
The tensor, represented as a span.
Returns
The index of the element in x
with the smallest magnitude (absolute value), or -1 if x
is empty.
Remarks
The determination of the minimum magnitude matches the IEEE 754:2019 `minimumMagnitude` 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 negative value is considered to have the smaller 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
IndexOfMinMagnitude<T>(ReadOnlySpan<T>)
Searches for the index of the number with the smallest magnitude in the specified tensor.
public:
generic <typename T>
where T : System::Numerics::INumber<T> static int IndexOfMinMagnitude(ReadOnlySpan<T> x);
public static int IndexOfMinMagnitude<T> (ReadOnlySpan<T> x) where T : System.Numerics.INumber<T>;
static member IndexOfMinMagnitude : ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> -> int (requires 'T :> System.Numerics.INumber<'T>)
Public Shared Function IndexOfMinMagnitude(Of T As INumber(Of T)) (x As ReadOnlySpan(Of T)) As Integer
Type Parameters
- T
Parameters
The tensor, represented as a span.
Returns
The index of the element in x
with the smallest magnitude (absolute value), or -1 if x
is empty.
Remarks
The determination of the minimum magnitude matches the IEEE 754:2019 `minimumMagnitude` 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 negative value is considered to have the smaller 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.