torch.utils.data

若API“是否支持”“是”“限制与说明”“-”,说明此API和原生API支持度保持一致。

API名称

是否支持

限制与说明

torch.utils.data.DataLoader

支持fp32

不支持多进程加载NPU数据,num_workers仅支持0

torch.utils.data.Dataset

支持fp16,fp32,fp64,uint8,int8,int16,int32,int64

torch.utils.data.IterableDataset

-

torch.utils.data.TensorDataset

-

torch.utils.data.StackDataset

-

torch.utils.data.ConcatDataset

-

torch.utils.data.ChainDataset

-

torch.utils.data.Subset

支持int64

torch.utils.data._utils.collate.collate

支持int64

torch.utils.data.default_collate

支持fp64,int64,bool

torch.utils.data.default_convert

-

torch.utils.data.get_worker_info

-

torch.utils.data.random_split

-

torch.utils.data.Sampler

支持int64

torch.utils.data.SequentialSampler

支持fp32

torch.utils.data.RandomSampler

支持fp32

torch.utils.data.SubsetRandomSampler

支持fp32

torch.utils.data.WeightedRandomSampler

支持fp32

torch.utils.data.BatchSampler

支持fp32

torch.utils.data.distributed.DistributedSampler

支持int32