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 compositonal get_item removing to_numpy and scalar calls while keeping it general enough #28077

Merged
merged 24 commits into from
Feb 20, 2024

Conversation

Ishticode
Copy link
Contributor

@Ishticode Ishticode commented Jan 27, 2024

Should give same output shapes.

import ivy
ivy.set_backend('tensorflow')
x = ivy.random_uniform(shape = (12, 1, 128, 3, 3))
y = ivy.randint(0, 1, shape=(6, 1))
print(x[y].shape)

ivy.set_backend('numpy')
x = ivy.random_uniform(shape = (12, 1, 128, 3, 3))
y = ivy.randint(0, 1, shape=(6, 1))
print(x[y].shape)

or

import ivy
ivy.set_backend('tensorflow')
x = ivy.random_uniform(shape = (256, 128, 3, 3))
y = ivy.randint(0, 1, shape=(6, 1))
print(x[y].shape)

ivy.set_backend('numpy')
x = ivy.random_uniform(shape = (256, 128, 3, 3))
y = ivy.randint(0, 1, shape=(6, 1))
print(x[y].shape)

…py getitem is. no tuple logic. still need to handle tuple case more carefully
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.

Conventional Commit PR Title

In order to be considered for merging, the pull request title must match the specification in conventional commits. You can edit the title in order for this check to pass.
Most often, our PR titles are something like one of these:

  • docs: correct typo in README
  • feat: implement dark mode"
  • fix: correct remove button behavior

Linting Errors

  • Found type "null", must be one of "feat","fix","docs","style","refactor","perf","test","build","ci","chore","revert"
  • No subject found

Copy link
Contributor

@vedpatwardhan vedpatwardhan left a comment

Choose a reason for hiding this comment

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

@mattbarrett98, can we please run the tracer transpiler tests for these changes to get_item if they break anything? Thanks @Ishticode, everything seems good to go (apart from the cleanup of the code that you're planning to do) 😄

@vedpatwardhan vedpatwardhan merged commit 704c571 into Transpile-AI:main Feb 20, 2024
75 of 141 checks passed
Kacper-W-Kozdon pushed a commit to Kacper-W-Kozdon/ivy that referenced this pull request Feb 22, 2024
…eping it general enough (Transpile-AI#28077)

Co-authored-by: ivy-branch <ivy.branch@lets-unify.ai>
Co-authored-by: Ved Patwardhan <54766411+vedpatwardhan@users.noreply.github.com>

Fixed the issues with the compositional implementations of get_item and set_item as they relied on numpy, reverted back to the previous implementation with some fixes for handling new_axes, to_front, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants