[docs]@contextmanager@recorddefworker_main()->Generator[None,None,None]:""" This is a context manager that wraps your main entry function. This combines the existing ``errors.record`` logic as well as a new ``_WorkerServer`` that exposes handlers via a unix socket specified by ``Torch_WORKER_SERVER_SOCKET``. Example :: @worker_main() def main(): pass if __name__=="__main__": main() """withExitStack()asstack:socket_path=os.environ.get(TORCH_WORKER_SERVER_SOCKET)ifsocket_pathisnotNone:stack.enter_context(_worker_server(socket_path))yield
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.