Skip to content
Snippets Groups Projects
Commit 664ee83b authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Fix pystencils.fields upgrade

parent 40ea9ea6
No related branches found
No related tags found
No related merge requests found
Pipeline #19222 failed
......@@ -31,7 +31,8 @@ def compatibility_hacks():
try:
import torch
from pystencils_autodiff.field_tensor_conversion import _torch_tensor_to_numpy_shim
kwargs = {k: _torch_tensor_to_numpy_shim(v) for k, v in kwargs.items() if isinstance(v, torch.Tensor)}
kwargs = {k: _torch_tensor_to_numpy_shim(v) if isinstance(
v, torch.Tensor) else v for k, v in kwargs.items()}
except ImportError:
torch = None
return _pystencils_fields(*args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment