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: fix test_torch__getitem fixing the empty dim case in tf backend #27953

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

Ishticode
Copy link
Contributor

This fixes test_torch___getitem. Passes with 200+ examples tested.
As an example, it fixes the following mismatch of behaviour between native torch and our torch frontend when tensorflow is set.

import torch
x = torch.tensor([])
y = torch.tensor(True)
print(x.__getitem__(y)) # tensor([], size=(1, 0))

import ivy.functional.frontends.torch as tivy
import ivy
ivy.set_backend('tensorflow')
x = tivy.tensor([])
y = tivy.tensor(True)
print("tf backend:", x.__getitem__(y)) # throws error

@Ishticode Ishticode self-assigned this Jan 18, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Compliance Checks

Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.

Issue Reference

In order to be considered for merging, the pull request description must refer to a specific issue number. This is described in our contributing guide and our PR template.
This check is looking for a phrase similar to: "Fixes #XYZ" or "Resolves #XYZ" where XYZ is the issue number that this PR is meant to address.

@Ishticode Ishticode merged commit 73dfaa1 into ivy-llc:main Jan 18, 2024
109 of 140 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants