MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _is_jax_array

Function _is_jax_array

lib/matplotlib/cbook.py:2442–2451  ·  view source on GitHub ↗

Return whether *x* is a JAX Array.

(x)

Source from the content-addressed store, hash-verified

2440
2441
2442def _is_jax_array(x):
2443 """Return whether *x* is a JAX Array."""
2444 try:
2445 # We're intentionally not attempting to import jax. If somebody
2446 # has created a jax array, jax should already be in sys.modules.
2447 tp = sys.modules.get("jax").Array
2448 except AttributeError:
2449 return False # Module not imported or a nonstandard module with no Array attr.
2450 return (isinstance(tp, type) # Just in case it's a very nonstandard module.
2451 and isinstance(x, tp))
2452
2453
2454def _is_mlx_array(x):

Callers 1

_unpack_to_numpyFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…