Skip to content

Commit

Permalink
fix type check (huggingface#12638)
Browse files Browse the repository at this point in the history
  • Loading branch information
patil-suraj authored Jul 12, 2021
1 parent 2dd9440 commit f8f9a67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1715,10 +1715,10 @@ def is_tensor(x):
return True

if is_flax_available():
import jaxlib.xla_extension as jax_xla
import jax.numpy as jnp
from jax.core import Tracer

if isinstance(x, (jax_xla.DeviceArray, Tracer)):
if isinstance(x, (jnp.ndarray, Tracer)):
return True

return isinstance(x, np.ndarray)
Expand Down

0 comments on commit f8f9a67

Please sign in to comment.