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

Discussion about the usage of torch.float64 #118

Open
GiulioRomualdi opened this issue Jan 8, 2025 · 1 comment
Open

Discussion about the usage of torch.float64 #118

GiulioRomualdi opened this issue Jan 8, 2025 · 1 comment

Comments

@GiulioRomualdi
Copy link
Member

I've noticed that in some parts, the fact that a torch type is float64 is forced. I think this can be problematic when we use Adam with other libraries.

A possibility is to remove the following lines

def __post_init__(self):
"""Converts array to double precision"""
if self.array.dtype != torch.float64:
self.array = self.array.double()

and

gravity: np.array = torch.tensor(
[0, 0, -9.80665, 0, 0, 0], dtype=torch.float64
),

so the user can force the float64 with torch.set_default_dtype(torch.float64) as is done in the tests

@GiulioRomualdi
Copy link
Member Author

cc @Giulero

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

No branches or pull requests

1 participant