TensorPrimitives.Negate Method

Definition

Overloads

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

Computes the element-wise negation of each single-precision floating-point number in the specified tensor.

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

Computes the element-wise negation of each number in the specified tensor.

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

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

Computes the element-wise negation of each single-precision floating-point number in the specified tensor.

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

Parameters

x
ReadOnlySpan<Single>

The tensor, represented as a span.

destination
Span<Single>

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] = -x[i].

If any of the element-wise input values is equal to NaN, the resulting element-wise value is also NaN.

Applies to

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

Source:
TensorPrimitives.Negate.cs
Source:
TensorPrimitives.Negate.cs

Computes the element-wise negation of each number in the specified tensor.

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

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The tensor, represented as a span.

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] = -x[i].

If any of the element-wise input values is equal to NaN, the resulting element-wise value is also NaN.

Applies to