Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __eq__(self, other):
return isinstance(other, ArrayT) and \
self.elt_type == other.elt_type and self.rank == other.rank
def type_of_value(x):
if np.isscalar(x):
return type_of_scalar(x)
elif isinstance(x, tuple):
elt_types = map(type_of_value, x)
return TupleT(elt_types)
elif isinstance(x, np.ndarray):
return ArrayT(from_dtype(x.dtype), np.rank(x))
else:
raise RuntimeError("Unsupported type " + str(type(x)))