def hamming(
a: _BufferType,
b: _BufferType,
/,
dtype: Literal['uint1', 'int4', 'uint4', 'int64', 'int32', 'int16', 'int8', 'uint64', 'uint32', 'uint16', 'uint8'] | _MiniFloatType | None = None,
*,
out: _BufferType | None = None,
out_dtype: _FloatTypeName | _MiniFloatType | None = None,
capabilities: Capability | int | None = ...,
stream: int | None = ...,
) -> float | Tensor | None Similar to scipy.spatial.distance.hamming. Two vectors give a scalar. Matrices pair row i of
a with row i of b, a single row pairing with every row of the other, into a new Tensor of
one result per pair, or into out, returning None.
Parameters
a_BufferType | First binary vector or matrix. | |
|---|---|---|
b_BufferType | Second binary vector or matrix, of the dtype of a. | |
dtypeLiteral['uint1', 'int4', 'uint4', 'int64', 'int32', 'int16', 'int8', 'uint64', 'uint32', 'uint16', 'uint8'] | _MiniFloatType | None | Input dtype to read both buffers as, overriding the one they report. | |
out_BufferType | None | Output vector for the results. | |
out_dtype_FloatTypeName | _MiniFloatType | None | Result dtype, by default that of out, else float64. | |
capabilitiesCapability | int | None | Capabilities to run within: every CPU one by default, or for packed operands the mask that packed them. | |
streamint | None | A GPU stream pointer, left None on the CPU. |