Created
February 13, 2024 12:04
-
-
Save aalmada/a9f939d76af5f16788a0440aba935ea8 to your computer and use it in GitHub Desktop.
Difference in behavior between Enumerable.Max() and TensorPrimitives.Max()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @nuget: System.Numerics.Tensors | |
using System; | |
using System.Linq; | |
using System.Numerics.Tensors; | |
float[] array = [1.0f, float.NaN, 2.0f]; | |
Console.WriteLine($"LINQ Min: {array.Min()}"); | |
Console.WriteLine($"LINQ Max: {array.Max()}"); | |
Console.WriteLine($"Tensors Min: {TensorPrimitives.Min(array)}"); | |
Console.WriteLine($"Tensors Max: {TensorPrimitives.Max(array)}"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment