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

Fixed device mismatch in energy_spectrum computation #108

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

eliseoe
Copy link
Contributor

@eliseoe eliseoe commented Sep 4, 2023

I addressed the device mismatch issue by specifying the device type in the torch.zeros call within the energy spectrum computation, see below:

# Before the change
torch.zeros((tuple([*leading_dims]) + tuple([torch.max(intk) + 1])))

# After the change
torch.zeros((tuple([*leading_dims]) + tuple([torch.max(intk) + 1])), device=self.device)

@eliseoe eliseoe linked an issue Sep 4, 2023 that may be closed by this pull request
@danielkelshaw danielkelshaw merged commit 2338b25 into main Sep 4, 2023
1 check failed
@danielkelshaw danielkelshaw deleted the elise-bugfix/torch_energy_spectrum branch September 4, 2023 12:44
@danielkelshaw
Copy link
Member

That's great, thank you!

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.

Correct pytorch energy spectrum device assignment
2 participants