Shortcuts

set_multithreading_enabled

class torch.autograd.grad_mode.set_multithreading_enabled(mode)[source][source]

Context-manager that sets multithreaded backwards on or off.

set_multithreading_enabled will enable or disable multithreaded backwards based on its argument mode. It can be used as a context-manager or as a function.

This context manager is thread local; it will not affect computation in other threads.

Parameters

mode (bool) – Flag whether to enable multithreaded backwards (True), or disable (False).

Note

This API does not apply to forward-mode AD.

clone()[source][source]

Create a copy of this class

Return type

set_multithreading_enabled

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources