Share via


TensorPrimitives.IsPow2Any<T>(ReadOnlySpan<T>) Method

Definition

Computes whether any of the values in the specified tensor are powers of two.

public:
generic <typename T>
 where T : System::Numerics::IBinaryNumber<T> static bool IsPow2Any(ReadOnlySpan<T> x);
public static bool IsPow2Any<T>(ReadOnlySpan<T> x) where T : System.Numerics.IBinaryNumber<T>;
static member IsPow2Any : ReadOnlySpan<'T (requires 'T :> System.Numerics.IBinaryNumber<'T>)> -> bool (requires 'T :> System.Numerics.IBinaryNumber<'T>)
Public Shared Function IsPow2Any(Of T As IBinaryNumber(Of T)) (x As ReadOnlySpan(Of T)) As Boolean

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The tensor, represented as a span.

Returns

true if any of the values in x are powers of two; otherwise, false. If x is empty, false is returned.

Applies to