shape may contain string attributes, which will be fetched from arg0 to
the function (usually self).
"""
print("has shape?", args)
self = args[0]
arg = args[arg_id]
if not hasattr(arg, "shape"):
raise ExpectedTypeError(arg, ["array"])
After Change
dim = getattr(self, dim, None)
shape_values.append(dim)
if len(shape) != len(arg.shape):
raise ShapeMismatchError(arg.shape, tuple(shape_values), shape)
for i, dim in enumerate(shape_values):
// Allow underspecified dimensions
if dim is not None and arg.shape[i] != dim: