Warning: this method is NOT part of the array API spec. Implementers of other libraries need not include it, and users should not assume it will be present in other implementations.
(self, dtype: None | np.dtype[Any] = None)
| 115 | # This function is not required by the spec, but we implement it here for |
| 116 | # convenience so that np.asarray(np.array_api.Array) will work. |
| 117 | def __array__(self, dtype: None | np.dtype[Any] = None) -> npt.NDArray[Any]: |
| 118 | """ |
| 119 | Warning: this method is NOT part of the array API spec. Implementers |
| 120 | of other libraries need not include it, and users should not assume it |
| 121 | will be present in other implementations. |
| 122 | |
| 123 | """ |
| 124 | return np.asarray(self._array, dtype=dtype) |
| 125 | |
| 126 | # These are various helper functions to make the array behavior match the |
| 127 | # spec in places where it either deviates from or is more strict than |
nothing calls this directly
no outgoing calls
no test coverage detected