Conversation
Update nb for device/dtype Default to cpu
|
| cls._device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | ||
| cls._device = torch.device("cpu") | ||
| if cls._dtype is None: | ||
| cls._dtype = torch.float64 |
There was a problem hiding this comment.
If users don't explicitly set device/dtype when creating tensors in the notebook, since the Torch defaults are different than ComputeConfig, this can cause problems. For dtype can we use float32 to match torch default. See related comments in #87.
I know that for tests (when checking the results against pcse), we need float64. Let's set this in the tests.
|
|
||
| def prepare_engine_input( | ||
| test_data, crop_model_params, meteo_range_checks=True, dtype=torch.float64, device="cpu" | ||
| ): |
There was a problem hiding this comment.
Lets keep this util function explicit and generic with arguments device/dtype. I the tests and notebook, we set the arguments using ComputeConfig . Otherwise this is hidden from the users.
SarahAlidoost
left a comment
There was a problem hiding this comment.
@SCiarella thanks for the fixes! 👍 please see my suggestions and also this issue #87. Sorry if it requires more changes than expected. We can also discuss the issue offline if needed.



Closes #84