Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if not hasattr(sig, "return_type"):
raise ValueError(
"signatures for ndreduce must be functions: {}".format(signature)
)
if any(ndim(arg) != 0 for arg in sig.args):
raise ValueError(
"all arguments in signature for ndreduce must be scalars: "
" {}".format(signature)
)
if ndim(sig.return_type) != 0:
raise ValueError(
"return type for ndreduce must be a scalar: {}".format(signature)
)
self.signature = signature
self._gufunc_cache = FunctionCache(self._create_gufunc)