Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions simplexity/utils/pytorch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def jax_to_torch(jax_array: jax.Array) -> torch.Tensor:

Args:
jax_array: JAX array to convert
device: Target PyTorch device (optional, will use JAX array's device if None)

Returns:
PyTorch tensor
Expand All @@ -36,8 +35,7 @@ def jax_to_torch(jax_array: jax.Array) -> torch.Tensor:
ImportError: If JAX or PyTorch is not available
"""
try:
dlpack_tensor = jax_dlpack.to_dlpack(jax_array)
torch_tensor = torch_dlpack.from_dlpack(dlpack_tensor)
torch_tensor = torch_dlpack.from_dlpack(jax_array)
return torch_tensor

except Exception as e:
Expand Down
Loading