Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix torch to numpy conversion when on GPU #1109

Merged

Conversation

mantasu
Copy link
Contributor

@mantasu mantasu commented Jul 2, 2024

Description

A small fix to properly convert torch.Tenor into numpy.ndarray. As mentioned, converting from torch to jax does not cause the same error, at least when jax[cuda] is installed.

Fixes #1108

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@pseudo-rnd-thoughts pseudo-rnd-thoughts changed the title Fix torch to numpy conversion Fix torch to numpy conversion when on GPU Jul 3, 2024
Copy link
Member

@pseudo-rnd-thoughts pseudo-rnd-thoughts left a comment

Choose a reason for hiding this comment

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

Thanks for the PR

@pseudo-rnd-thoughts pseudo-rnd-thoughts merged commit c3af58e into Farama-Foundation:main Jul 3, 2024
13 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] torch_to_numpy fails when tensors are not on cpu
2 participants