W3cubDocs

/PyTorch 2.9

torch.compiler.disable

torch.compiler.disable(fn=None, recursive=True, *, reason=None) [source]

This function provides a decorator to disable compilation on a function. It also provides the option of recursively disabling called functions.

Parameters
  • fn (optional) – The function to disable
  • recursive (optional) – A boolean value indicating whether the disabling should be recursive.
  • reason (optional) – A string value indicating the reason for disabling the function.

© 2025, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.9/generated/torch.compiler.disable.html