Skip to content

Commit 29a85ba

Browse files
ConchylicultorThe dataclass_array Authors
authored andcommitted
Fix bad lazy resolve
PiperOrigin-RevId: 509456292
1 parent 12c3785 commit 29a85ba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

dataclass_array/array_dataclass.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,8 @@ def as_xnp(self: _DcT, xnp: enp.NpModule) -> _DcT:
463463
return self
464464
# Direct `torch` <> `tf`/`jax` conversion not supported, so convert to
465465
# `numpy`
466-
if (
467-
enp.lazy.has_torch
468-
and xnp is enp.lazy.torch
469-
or self.xnp is enp.lazy.torch
466+
if enp.lazy.has_torch and (
467+
xnp is enp.lazy.torch or self.xnp is enp.lazy.torch
470468
):
471469
array_fn = lambda f: xnp.asarray(np.asarray(f.value))
472470
else:

0 commit comments

Comments
 (0)