TensorPrimitives.OnesComplement<T> 方法

定义

计算指定张量中的按元素计算数字的补数。

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

类型参数

T

参数

x
ReadOnlySpan<T>

第一个张量,表示为范围。

destination
Span<T>

目标张量,表示为范围。

例外

xdestination 引用重叠的内存位置,并且不在同一位置开始。

注解

此方法有效地计算 destination[i] = ~x[i]

适用于