diff --git a/autograd/numpy/numpy_boxes.py b/autograd/numpy/numpy_boxes.py index 937037a4..b9c73963 100644 --- a/autograd/numpy/numpy_boxes.py +++ b/autograd/numpy/numpy_boxes.py @@ -1,3 +1,5 @@ +from typing import Union + import numpy as np from autograd.builtins import SequenceBox @@ -23,6 +25,9 @@ def __getitem__(A, idx): dtype = property(lambda self: self._value.dtype) T = property(lambda self: anp.transpose(self)) + def __array_namespace__(self, *, api_version: Union[str, None] = None): + return anp + def __len__(self): return len(self._value)