快捷方式

事件

模块包含与标准 Python 日志记录集成的事件处理机制。

使用示例

from torch.distributed.elastic import events
event = events.Event(name="test_event", source=events.EventSource.WORKER, metadata={...})
events.get_logging_handler(destination="console").info(event)

API 方法

torch.distributed.elastic.events.record(event, destination='null')[source]
torch.distributed.elastic.events.get_logging_handler(destination='null')[source]
返回类型

处理程序

事件对象

class torch.distributed.elastic.events.api.Event(name, source, timestamp=0, metadata=<factory>)[source]

该类表示在 torchelastic 作业执行期间发生的通用事件。

事件可以是任何有意义的操作。

参数
class torch.distributed.elastic.events.api.EventSource(value)[source]

事件生产者的已知标识符。

torch.distributed.elastic.events.api.EventMetadataValue

Optional[Union[str, int, float, bool]] 的别名

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

获取针对初学者和高级开发人员的深入教程

查看教程

资源

查找开发资源并获得问题的解答

查看资源