TensorPrimitives.HammingDistance<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Computes the Hamming distance between two equal-length tensors of values.
public:
generic <typename T>
static int HammingDistance(ReadOnlySpan<T> x, ReadOnlySpan<T> y);
public static int HammingDistance<T> (ReadOnlySpan<T> x, ReadOnlySpan<T> y);
static member HammingDistance : ReadOnlySpan<'T> * ReadOnlySpan<'T> -> int
Public Shared Function HammingDistance(Of T) (x As ReadOnlySpan(Of T), y As ReadOnlySpan(Of T)) As Integer
Type Parameters
- T
Parameters
The first tensor, represented as a span.
The second tensor, represented as a span.
Returns
The number of elements that differ between the two spans.
Exceptions
x
and y
must not be empty.
Remarks
This method computes the number of locations i
where !EqualityComparer>T<.Default.Equal(x[i], y[i])
.
Applies to
Tee yhteistyötä kanssamme GitHubissa
Tämän sisällön lähde on GitHubissa, jossa voit myös luoda ja tarkastella ongelmia ja pull-pyyntöjä. Katso lisätietoja osallistujan oppaasta.