(beta)torch_npu.contrib.Prefetcher
接口原型
torch_npu.contrib.Prefetcher(loader, stream=None)
功能描述
npu设备上使用的预取程序。
参数说明
- loder (torch.utils.data.DataLoader or DataLoader like iterator):Using to generate inputs after preprocessing.
- stream (torch.npu.Stream):Default None.Because of the limitation of NPU's memory mechanism,if prefetcher is initialized repeatedly during training,a defined stream should be introduced to prevent memory leakage;if prefetcher is initialized only once during training,a defined stream is not necessary.
支持的型号
- Atlas 训练系列产品
- Atlas A2 训练系列产品
- Atlas 推理系列产品
父主题: torch_npu.contrib