(self)
| 867 | return float(self._numpy()) |
| 868 | |
| 869 | def __index__(self): |
| 870 | maybe_arr = self._numpy() |
| 871 | if isinstance(maybe_arr, np.ndarray): |
| 872 | return maybe_arr.__index__() |
| 873 | return int(maybe_arr) # Must be a NumPy scalar. |
| 874 | |
| 875 | def __bool__(self): |
| 876 | return bool(self._numpy()) |