Tensor.CosineSimilarity<T> Method
In this article
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
- T
The first ReadOnlyTensorSpan<T>
The second ReadOnlyTensorSpan<T>
Applies to
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |