Fix expand_dims
@@ -155,7 +155,7 @@ def expand_dims(a, axis):
shape = a.shape
if axis < 0:
axis = axis + len(shape) + 1
- if axis > a.shape or axis < 0:
+ if axis > a.ndim or axis < 0:
# TODO(unno): Too large and too small axis is deprecated in NumPy 1.13
# We need to fix this behavior after NumPy forbids it.
warnings.warn(
