TensorPrimitives.PopCount Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přetížení
PopCount<T>(ReadOnlySpan<T>, Span<T>) |
Vypočítá počet čísel v zadaném tensoru, který je moudrý. |
PopCount<T>(ReadOnlySpan<T>) |
Vypočítá počet obyvatel všech prvků v zadaném tensoru. |
PopCount<T>(ReadOnlySpan<T>, Span<T>)
Vypočítá počet čísel v zadaném tensoru, který je moudrý.
public:
generic <typename T>
where T : System::Numerics::IBinaryInteger<T> static void PopCount(ReadOnlySpan<T> x, Span<T> destination);
public static void PopCount<T> (ReadOnlySpan<T> x, Span<T> destination) where T : System.Numerics.IBinaryInteger<T>;
static member PopCount : 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 PopCount(Of T As IBinaryInteger(Of T)) (x As ReadOnlySpan(Of T), destination As Span(Of T))
Parametry typu
- T
Parametry
Tenzor, reprezentovaný jako rozpětí.
- destination
- Span<T>
Cílový tensor, reprezentovaný jako rozpětí.
Výjimky
x
a destination
odkazují na překrývající se umístění paměti a nezačínají ve stejném umístění.
Poznámky
Tato metoda efektivně vypočítá
.destination
[i] = T.PopCount(x
[i])
Platí pro
PopCount<T>(ReadOnlySpan<T>)
Vypočítá počet obyvatel všech prvků v zadaném tensoru.
public:
generic <typename T>
where T : System::Numerics::IBinaryInteger<T> static long PopCount(ReadOnlySpan<T> x);
public static long PopCount<T> (ReadOnlySpan<T> x) where T : System.Numerics.IBinaryInteger<T>;
static member PopCount : ReadOnlySpan<'T (requires 'T :> System.Numerics.IBinaryInteger<'T>)> -> int64 (requires 'T :> System.Numerics.IBinaryInteger<'T>)
Public Shared Function PopCount(Of T As IBinaryInteger(Of T)) (x As ReadOnlySpan(Of T)) As Long
Parametry typu
- T
Parametry
Tenzor, reprezentovaný jako rozpětí.
Návraty
Součet počtu bitů nastavených v každém prvku v x
.