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 stack 2x2 tensor along dimension 1 #108620

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

kasperk81
Copy link
Contributor

fix #108615

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Oct 7, 2024
@kasperk81
Copy link
Contributor Author

was

System.Numerics.Tensors.Tests.TensorTests.TensorStackTests [FAIL]
  Assert.Equal() Failure: Values differ
  Expected: 10
  Actual:   1

now passing

@kasperk81 kasperk81 marked this pull request as ready for review October 7, 2024 20:34
@MihaZupan
Copy link
Member

Does this part have a similar issue ([0] index + outputs being ignored)?

Tensor<T>[] outputs = new Tensor<T>[tensors.Length];
for (int i = 0; i < tensors.Length; i++)
{
outputs[i] = Tensor.Unsqueeze(tensors[0], dimension);
}
return ref Tensor.ConcatenateOnDimension<T>(dimension, tensors, destination);

@jeffhandley
Copy link
Member

@tannergooding / @michaelgsharp -- Once this is merged, let's backport it to release/9.0-staging for servicing.

@tannergooding tannergooding merged commit d2fdf24 into dotnet:main Nov 21, 2024
81 of 83 checks passed
@tannergooding
Copy link
Member

/backport to release/9.0-staging

Copy link
Contributor

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/11956969073

@MihaZupan
Copy link
Member

@tannergooding the outputs array here appears to be ignored as well

Tensor<T>[] outputs = new Tensor<T>[tensors.Length];
for (int i = 0; i < tensors.Length; i++)
{
outputs[i] = Tensor.Unsqueeze(tensors[i], dimension);
}
return ref Tensor.ConcatenateOnDimension<T>(dimension, tensors, destination);

@tannergooding
Copy link
Member

@MihaZupan, indeed. Would you like to get a small fix up?

@MihaZupan
Copy link
Member

I can probably look at it next week if need be, just didn't want it to slip through if we're backporting changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Numerics.Tensors community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StackAlongDimension does not return correct result
4 participants