Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TensorPrimitives.IndexOfXx corner-case when first element is seed value #93169

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ public static unsafe int IndexOfMax(ReadOnlySpan<float> x)

if (!x.IsEmpty)
{
result = 0;
float max = float.NegativeInfinity;

for (int i = 0; i < x.Length; i++)
Expand Down Expand Up @@ -382,6 +383,7 @@ public static unsafe int IndexOfMaxMagnitude(ReadOnlySpan<float> x)

if (!x.IsEmpty)
{
result = 0;
float max = float.NegativeInfinity;
float maxMag = float.NegativeInfinity;

Expand Down Expand Up @@ -435,6 +437,7 @@ public static unsafe int IndexOfMin(ReadOnlySpan<float> x)

if (!x.IsEmpty)
{
result = 0;
float min = float.PositiveInfinity;

for (int i = 0; i < x.Length; i++)
Expand Down Expand Up @@ -485,6 +488,7 @@ public static unsafe int IndexOfMinMagnitude(ReadOnlySpan<float> x)

if (!x.IsEmpty)
{
result = 0;
float min = float.PositiveInfinity;
float minMag = float.PositiveInfinity;

Expand Down
Loading