Condividi tramite


TensorPrimitives.MinMagnitude Method

Definition

Overloads

MinMagnitude(ReadOnlySpan<Single>)

Searches for the single-precision floating-point number with the smallest magnitude in the specified tensor.

MinMagnitude(ReadOnlySpan<Single>, ReadOnlySpan<Single>, Span<Single>)

Computes the element-wise single-precision floating-point number with the smallest magnitude in the specified tensors.

MinMagnitude<T>(ReadOnlySpan<T>)

Searches for the number with the smallest magnitude in the specified tensor.

MinMagnitude<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Span<T>)

Computes the element-wise number with the smallest magnitude in the specified tensors.

MinMagnitude<T>(ReadOnlySpan<T>, T, Span<T>)

Computes the element-wise number with the smallest magnitude in the specified tensors.

MinMagnitude(ReadOnlySpan<Single>)

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

Searches for the single-precision floating-point number with the smallest magnitude in the specified tensor.

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

Parameters

x
ReadOnlySpan<Single>

The tensor, represented as a span.

Returns

The element in x with the smallest magnitude (absolute value).

Exceptions

Length of x must be greater than zero.

Remarks

The determination of the minimum magnitude matches the IEEE 754:2019 `minimumMagnitude` function. If any value equal to NaN is present, 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

MinMagnitude(ReadOnlySpan<Single>, ReadOnlySpan<Single>, Span<Single>)

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

Computes the element-wise single-precision floating-point number with the smallest magnitude in the specified tensors.

public:
 static void MinMagnitude(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination);
public static void MinMagnitude (ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination);
static member MinMagnitude : ReadOnlySpan<single> * ReadOnlySpan<single> * Span<single> -> unit
Public Shared Sub MinMagnitude (x As ReadOnlySpan(Of Single), y As ReadOnlySpan(Of Single), destination As Span(Of Single))

Parameters

x
ReadOnlySpan<Single>

The first tensor, represented as a span.

y
ReadOnlySpan<Single>

The second tensor, represented as a span.

destination
Span<Single>

The destination tensor, represented as a span.

Exceptions

y and destination reference overlapping memory locations and do not begin at the same location.

Remarks

This method effectively computes destination[i] = MathF.MinMagnitude(x[i], y[i]).

Applies to

MinMagnitude<T>(ReadOnlySpan<T>)

Source:
TensorPrimitives.MinMagnitude.cs
Source:
TensorPrimitives.MinMagnitude.cs

Searches for the number with the smallest magnitude in the specified tensor.

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

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The tensor, represented as a span.

Returns

T

The element in x with the smallest magnitude (absolute value).

Exceptions

Length of x must be greater than zero.

Remarks

The determination of the minimum magnitude matches the IEEE 754:2019 `minimumMagnitude` function. If any value equal to NaN is present, 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

MinMagnitude<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Span<T>)

Source:
TensorPrimitives.MinMagnitude.cs
Source:
TensorPrimitives.MinMagnitude.cs

Computes the element-wise number with the smallest magnitude in the specified tensors.

public:
generic <typename T>
 where T : System::Numerics::INumberBase<T> static void MinMagnitude(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination);
public static void MinMagnitude<T> (ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) where T : System.Numerics.INumberBase<T>;
static member MinMagnitude : ReadOnlySpan<'T (requires 'T :> System.Numerics.INumberBase<'T>)> * ReadOnlySpan<'T (requires 'T :> System.Numerics.INumberBase<'T>)> * Span<'T (requires 'T :> System.Numerics.INumberBase<'T>)> -> unit (requires 'T :> System.Numerics.INumberBase<'T>)
Public Shared Sub MinMagnitude(Of T As INumberBase(Of T)) (x As ReadOnlySpan(Of T), y As ReadOnlySpan(Of T), destination As Span(Of T))

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The first tensor, represented as a span.

y
ReadOnlySpan<T>

The second tensor, represented as a span.

destination
Span<T>

The destination tensor, represented as a span.

Exceptions

y and destination reference overlapping memory locations and do not begin at the same location.

Remarks

This method effectively computes destination[i] = T.MinMagnitude(x[i], y[i]).

Applies to

MinMagnitude<T>(ReadOnlySpan<T>, T, Span<T>)

Source:
TensorPrimitives.MinMagnitude.cs
Source:
TensorPrimitives.MinMagnitude.cs

Computes the element-wise number with the smallest magnitude in the specified tensors.

public:
generic <typename T>
 where T : System::Numerics::INumberBase<T> static void MinMagnitude(ReadOnlySpan<T> x, T y, Span<T> destination);
public static void MinMagnitude<T> (ReadOnlySpan<T> x, T y, Span<T> destination) where T : System.Numerics.INumberBase<T>;
static member MinMagnitude : ReadOnlySpan<'T (requires 'T :> System.Numerics.INumberBase<'T>)> * 'T * Span<'T (requires 'T :> System.Numerics.INumberBase<'T>)> -> unit (requires 'T :> System.Numerics.INumberBase<'T>)
Public Shared Sub MinMagnitude(Of T As INumberBase(Of T)) (x As ReadOnlySpan(Of T), y As T, destination As Span(Of T))

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The first tensor, represented as a span.

y
T

The second tensor, represented as a scalar.

destination
Span<T>

The destination tensor, represented as a span.

Exceptions

x and destination reference overlapping memory locations and do not begin at the same location.

Remarks

This method effectively computes destination[i] = T.MinMagnitude(x[i], y).

Applies to