Share via


TensorPrimitives.IsPow2<T> Method

Definition

Computes for each value in the specified tensor whether it's a power of two.

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

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The tensor, represented as a span.

destination
Span<Boolean>

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.IsPow2(x[i]).

Applies to