Share via


TensorPrimitives.CopySign Method

Definition

Overloads

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

Computes the element-wise result of copying the sign from one number to another number in the specified tensors.

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

Computes the element-wise result of copying the sign from one number to another number in the specified tensors.

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

Source:
TensorPrimitives.CopySign.cs
Source:
TensorPrimitives.CopySign.cs

Computes the element-wise result of copying the sign from one number to another number in the specified tensors.

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

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The first tensor, represented as a span.

sign
ReadOnlySpan<T>

The second tensor, represented as a span.

destination
Span<T>

The destination tensor, represented as a span.

Exceptions

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

Remarks

This method effectively computes destination[i] = T.CopySign(x[i], sign[i]).

Applies to

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

Source:
TensorPrimitives.CopySign.cs
Source:
TensorPrimitives.CopySign.cs

Computes the element-wise result of copying the sign from one number to another number in the specified tensors.

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

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The first tensor, represented as a span.

sign
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.CopySign(x[i], sign[i]).

Applies to