Return whether *x* is a MLX Array.
(x)
| 2452 | |
| 2453 | |
| 2454 | def _is_mlx_array(x): |
| 2455 | """Return whether *x* is a MLX Array.""" |
| 2456 | try: |
| 2457 | # We're intentionally not attempting to import mlx. If somebody |
| 2458 | # has created a mlx array, mlx should already be in sys.modules. |
| 2459 | tp = sys.modules.get("mlx.core").array |
| 2460 | except AttributeError: |
| 2461 | return False # Module not imported or a nonstandard module with no Array attr. |
| 2462 | return (isinstance(tp, type) # Just in case it's a very nonstandard module. |
| 2463 | and isinstance(x, tp)) |
| 2464 | |
| 2465 | |
| 2466 | def _is_pandas_dataframe(x): |
no test coverage detected
searching dependent graphs…