PyTorch与MindSpore API映射表¶
由社区提供的PyTorch APIs和MindSpore APIs之间的映射,可能在参数、输入、输出、逻辑功能和特定场景等方面存在差异,可详见各API描述或已提供的差异对比。
也欢迎更多的MindSpore开发者参与完善映射内容。
PyTorch 1.8.1¶
torch¶
torch.distributed¶
torch.nn¶
torch.nn.functional¶
torch.Tensor¶
torch.optim¶
torch.utils¶
PyTorch 1.5.0¶
torch¶
torch.autograd¶
torch.cuda¶
PyTorch 1.5.0 APIs | MindSpore APIs | 说明 |
---|---|---|
torch.cuda.device_count | mindspore.communication.get_group_size | |
torch.cuda.set_device | mindspore.set_context | 差异对比 |
torch.distributions¶
PyTorch 1.5.0 APIs | MindSpore APIs | 说明 |
---|---|---|
torch.distributions.gamma.Gamma | mindspore.ops.Gamma |