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
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.