共用方式為


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]

適用於