Tensor.CosineSimilarity<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.
Compute cosine similarity between x and y.
public:
generic <typename T>
where T : System::Numerics::IRootFunctions<T> static T CosineSimilarity(System::Numerics::Tensors::ReadOnlyTensorSpan<T> % x, System::Numerics::Tensors::ReadOnlyTensorSpan<T> % y);
public static T CosineSimilarity<T>(in System.Numerics.Tensors.ReadOnlyTensorSpan<T> x, in System.Numerics.Tensors.ReadOnlyTensorSpan<T> y) where T : System.Numerics.IRootFunctions<T>;
static member CosineSimilarity : ReadOnlyTensorSpan * ReadOnlyTensorSpan -> 'T (requires 'T :> System.Numerics.IRootFunctions<'T>)
Public Function CosineSimilarity(Of T As IRootFunctions(Of T)) (ByRef x As ReadOnlyTensorSpan(Of T), ByRef y As ReadOnlyTensorSpan(Of T)) As T
Type Parameters
- T
Parameters
The first ReadOnlyTensorSpan<T>
The second ReadOnlyTensorSpan<T>