How to use the numbagg.cache.FunctionCache function in numbagg

To help you get started, we’ve selected a few numbagg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shoyer / numbagg / numbagg / decorators.py View on Github external
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)