Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion src/maxdiffusion/models/modeling_flax_pytorch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def torch2jax(torch_tensor: torch.Tensor) -> Array:
torch_tensor = torch_tensor.to("cpu")

numpy_value = torch_tensor.numpy()
jax_array = jnp.array(numpy_value, dtype=jnp.bfloat16 if is_bfloat16 else None)
local_cpu_device_0 = jax.local_devices(backend="cpu")[0]
jax_array = jnp.array(numpy_value, dtype=jnp.bfloat16 if is_bfloat16 else None, device=local_cpu_device_0)
return jax_array


Expand Down
Loading
Loading