TensorPrimitives.HammingBitDistance<T> Method

Definition

Computes the bitwise Hamming distance between two equal-length tensors of values.

public:
generic <typename T>
 where T : System::Numerics::IBinaryInteger<T> static long HammingBitDistance(ReadOnlySpan<T> x, ReadOnlySpan<T> y);
public static long HammingBitDistance<T> (ReadOnlySpan<T> x, ReadOnlySpan<T> y) where T : System.Numerics.IBinaryInteger<T>;
static member HammingBitDistance : ReadOnlySpan<'T (requires 'T :> System.Numerics.IBinaryInteger<'T>)> * ReadOnlySpan<'T (requires 'T :> System.Numerics.IBinaryInteger<'T>)> -> int64 (requires 'T :> System.Numerics.IBinaryInteger<'T>)
Public Shared Function HammingBitDistance(Of T As IBinaryInteger(Of T)) (x As ReadOnlySpan(Of T), y As ReadOnlySpan(Of T)) As Long

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The first tensor, represented as a span.

y
ReadOnlySpan<T>

The second tensor, represented as a span.

Returns

The number of bits that differ between the two spans.

Exceptions

x and y must not be empty.

Applies to