set_multithreading_enabled#
- classtorch.autograd.grad_mode.set_multithreading_enabled(mode)[source]#
Context-manager that sets multithreaded backwards on or off.
set_multithreading_enabledwill enable or disable multithreaded backwards based on its argumentmode.It can be used as a context-manager or as a function.This context manager is thread local; it will not affect computationin other threads.
- Parameters
mode (bool) – Flag whether to enable multithreaded backwards (
True), or disable(False).
Note
This API does not apply toforward-mode AD.