共用方式為


TensorPrimitives.LeadingZeroCount<T> 方法

定義

計算指定之張量中的元素前置零計數。

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

類型參數

T

參數

x
ReadOnlySpan<T>

以範圍表示的張量。

destination
Span<T>

目的地張量,以範圍表示。

例外狀況

xdestination 參考重疊的記憶體位置,而且不會從相同的位置開始。

備註

這個方法會有效地計算 destination[i] = T.LeadingZeroCount(x[i])

適用於