TensorPrimitives.Negate 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
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
The 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
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.