[docs]defis_available():r"""Return whether PyTorch is built with NNPACK support."""returntorch._nnpack_available()
[docs]defset_flags(_enabled):r"""Set if nnpack is enabled globally"""orig_flags=(torch._C._get_nnpack_enabled(),)torch._C._set_nnpack_enabled(_enabled)returnorig_flags
[docs]@contextmanagerdefflags(enabled=False):r"""Context manager for setting if nnpack is enabled globally"""with__allow_nonbracketed_mutation():orig_flags=set_flags(enabled)try:yieldfinally:with__allow_nonbracketed_mutation():set_flags(orig_flags[0])
Docs
Access comprehensive developer documentation for PyTorch
To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.