# PyTorch and MindSpore API Mapping Table Mapping between TensorFlow APIs and MindSpore APIs, which is provided by the community. There may be differences in parameters, inputs, outputs, logic functions, and specific scenarios. For details, see the description of each API or the difference comparison provided. More MindSpore developers are also welcome to participate in improving the mapping content. ## PyTorch 1.8.1 ### torch | PyTorch 1.8.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.abs](https://pytorch.org/docs/1.8.1/generated/torch.abs.html) | [mindspore.ops.abs](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.abs.html) | Difference comparison is under development. | | [torch.acos](https://pytorch.org/docs/1.8.1/generated/torch.acos.html) | [mindspore.ops.acos](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.acos.html) | Difference comparison is under development. | | [torch.add](https://pytorch.org/docs/1.8.1/generated/torch.add.html) | [mindspore.ops.add](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.add.html) | Difference comparison is under development. | | [torch.addbmm](https://pytorch.org/docs/1.8.1/generated/torch.addbmm.html) | [mindspore.ops.addbmm](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.addbmm.html) | The functions are consistent, but the parameter names are inconsistent.| | [torch.addmm](https://pytorch.org/docs/1.8.1/generated/torch.addmm.html) | [mindspore.ops.addmm](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.addmm.html) | The functions are consistent, but the parameter names are inconsistent.| | [torch.angle](https://pytorch.org/docs/1.8.1/generated/torch.angle.html) | [mindspore.ops.angle](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.angle.html) | The functions are consistent. | | [torch.arccosh](https://pytorch.org/docs/1.8.1/generated/torch.arccosh.html) | [mindspore.ops.arccosh](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.arccosh.html) | The functions are consistent, but the parameter names are inconsistent.| | [torch.arcsin](https://pytorch.org/docs/1.8.1/generated/torch.arcsin.html) | [mindspore.ops.arcsin](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.arcsin.html) | The functions are consistent, but the parameter names are inconsistent.| | [torch.arctan](https://pytorch.org/docs/1.8.1/generated/torch.arctan.html) | [mindspore.ops.arctan](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.arctan.html) | The functions are consistent, but the parameter names are inconsistent.| | [torch.asin](https://pytorch.org/docs/1.8.1/generated/torch.asin.html) | [mindspore.ops.asin](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.asin.html) | Difference comparison is under development. | | [torch.atan](https://pytorch.org/docs/1.8.1/generated/torch.atan.html) | [mindspore.ops.atan](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.atan.html) | Difference comparison is under development. | | [torch.atan2](https://pytorch.org/docs/1.8.1/generated/torch.atan2.html) | [mindspore.ops.atan2](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.atan2.html) | Difference comparison is under development. | | [torch.baddbmm](https://pytorch.org/docs/1.8.1/generated/torch.baddbmm.html) | [mindspore.ops.baddbmm](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.baddbmm.html) | The functions are consistent, but the parameter names are inconsistent. | | [torch.bartlett_window](https://pytorch.org/docs/1.8.1/generated/torch.bartlett_window.html) | [mindspore.ops.bartlett_window](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.bartlett_window.html) | Difference comparison is under development. | | [torch.bitwise_and](https://pytorch.org/docs/1.8.1/generated/torch.bitwise_and.html) | [mindspore.ops.bitwise_and](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.bitwise_and.html) | Difference comparison is under development. | | [torch.bitwise_or](https://pytorch.org/docs/1.8.1/generated/torch.bitwise_or.html) | [mindspore.ops.bitwise_or](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.bitwise_or.html) | Difference comparison is under development. | | [torch.bitwise_xor](https://pytorch.org/docs/1.8.1/generated/torch.bitwise_xor.html) | [mindspore.ops.bitwise_xor](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.bitwise_xor.html) | Difference comparison is under development. | | [torch.blackman_window](https://pytorch.org/docs/1.8.1/generated/torch.blackman_window.html) | [mindspore.ops.blackman_window](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.blackman_window.html) | Difference comparison is under development. | | [torch.bmm](https://pytorch.org/docs/1.8.1/generated/torch.bmm.html) | [mindspore.ops.BatchMatMul](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.BatchMatMul.html) | Difference comparison is under development. | | [torch.broadcast_to](https://pytorch.org/docs/1.8.1/generated/torch.broadcast_to.html) | [mindspore.ops.broadcast_to](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.broadcast_to.html) | Difference comparison is under development. | | [torch.ceil](https://pytorch.org/docs/1.8.1/generated/torch.ceil.html) | [mindspore.ops.ceil](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ceil.html) | Difference comparison is under development. | | [torch.conj](https://pytorch.org/docs/1.8.1/generated/torch.conj.html) | [mindspore.ops.conj](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.conj.html) | Difference comparison is under development. | | [torch.cos](https://pytorch.org/docs/1.8.1/generated/torch.cos.html) | [mindspore.ops.cos](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.cos.html) | Difference comparison is under development. | | [torch.cosh](https://pytorch.org/docs/1.8.1/generated/torch.cosh.html) | [mindspore.ops.cosh](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.cosh.html) | Difference comparison is under development. | | [torch.cross](https://pytorch.org/docs/1.8.1/generated/torch.cross.html) | [mindspore.numpy.cross](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.cross.html#mindspore.numpy.cross) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/mindspore.numpy.cross.html) | | [torch.cumprod](https://pytorch.org/docs/1.8.1/generated/torch.cumprod.html) | [mindspore.ops.cumprod](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.cumprod.html) | Difference comparison is under development. | | [torch.cumsum](https://pytorch.org/docs/1.8.1/generated/torch.cumsum.html) | [mindspore.ops.cumsum](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.cumsum.html) | Difference comparison is under development. | | [torch.div](https://pytorch.org/docs/1.8.1/generated/torch.div.html) | [mindspore.ops.div](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.div.html) | Difference comparison is under development. | | [torch.divide](https://pytorch.org/docs/1.8.1/generated/torch.divide.html) | [mindspore.ops.divide](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.divide.html) | The functions are consistent. | | [torch.empty](https://pytorch.org/docs/1.8.1/generated/torch.empty.html) | [mindspore.numpy.empty](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.empty.html) | Difference comparison is under development. | | [torch.empty_like](https://pytorch.org/docs/1.8.1/generated/torch.empty_like.html) | [mindspore.numpy.empty_like](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.empty_like.html) | Difference comparison is under development. | | [torch.eq](https://pytorch.org/docs/1.8.1/generated/torch.eq.html) | [mindspore.ops.equal](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.equal.html) | Difference comparison is under development. | | [torch.erfc](https://pytorch.org/docs/1.8.1/generated/torch.erfc.html) | [mindspore.ops.erfc](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.erfc.html) | Difference comparison is under development. | | [torch.erfinv](https://pytorch.org/docs/1.8.1/generated/torch.erfinv.html) | [mindspore.ops.erfinv](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.erfinv.html) | Difference comparison is under development.| | [torch.exp](https://pytorch.org/docs/1.8.1/generated/torch.exp.html) | [mindspore.ops.exp](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.exp.html) | Difference comparison is under development. | | [torch.expm1](https://pytorch.org/docs/1.8.1/generated/torch.expm1.html) | [mindspore.ops.expm1](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.expm1.html) | Difference comparison is under development. | | [torch.eye](https://pytorch.org/docs/1.8.1/generated/torch.eye.html) | [mindspore.ops.eye](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.eye.html) | Difference comparison is under development. | | [torch.flip](https://pytorch.org/docs/1.8.1/generated/torch.flip.html) | [mindspore.ops.flip](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.flip.html) | Difference comparison is under development.| | [torch.fliplr](https://pytorch.org/docs/1.8.1/generated/torch.fliplr.html) | [mindspore.ops.fliplr](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.fliplr.html) | Difference comparison is under development.| | [torch.flipud](https://pytorch.org/docs/1.8.1/generated/torch.flipud.html) | [mindspore.ops.flipud](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.flipud.html) | Difference comparison is under development.| | [torch.full](https://pytorch.org/docs/1.8.1/generated/torch.full.html) | [mindspore.numpy.full](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.full.html) | Difference comparison is under development. | | [torch.full_like](https://pytorch.org/docs/1.8.1/generated/torch.full_like.html) | [mindspore.numpy.full_like](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.full_like.html) | Difference comparison is under development. | | [torch.hann_window](https://pytorch.org/docs/1.8.1/generated/torch.hann_window.html) | [mindspore.numpy.hanning](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.hanning.html) | Difference comparison is under development. | | [torch.is_floating_point](https://pytorch.org/docs/1.8.1/generated/torch.is_floating_point.html) | [mindspore.ops.is_floating_point](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.is_floating_point.html) | Difference comparison is under development.| | [torch.negative](https://pytorch.org/docs/1.8.1/generated/torch.negative.html) | [mindspore.ops.negative](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.negative.html) | The functions are consistent, but the parameter names are inconsistent.| | [torch.numel](https://pytorch.org/docs/1.8.1/generated/torch.numel.html) | [mindspore.ops.numel](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.numel.html) | The functions are consistent, but the parameter names are inconsistent.| | [torch.roll](https://pytorch.org/docs/1.8.1/generated/torch.roll.html) | [mindspore.ops.roll](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.roll.html) | Difference comparison is under development.| | [torch.unsqueeze](https://pytorch.org/docs/1.8.1/generated/torch.unsqueeze.html) | [mindspore.ops.expand_dims](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.expand_dims.html) |Difference comparison is under development. | ### torch.distributed | PyTorch 1.8.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.distributed.all_gather](https://pytorch.org/docs/1.8.1/distributed.html#torch.distributed.all_gather) | [mindspore.ops.AllGather](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.AllGather.html#mindspore.ops.AllGather) |[diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/all_gather.html)| | [torch.distributed.all_reduce](https://pytorch.org/docs/1.8.1/distributed.html#torch.distributed.all_reduce) | [mindspore.ops.AllReduce](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.AllReduce.html#mindspore.ops.AllReduce) |[diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/all_reduce.html)| | [torch.distributed.get_rank](https://pytorch.org/docs/1.8.1/distributed.html#torch.distributed.get_rank) | [mindspore.communication.get_rank](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.communication.html#mindspore.communication.get_rank) |[diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/get_rank.html)| | [torch.distributed.init_process_group](https://pytorch.org/docs/1.8.1/distributed.html#torch.distributed.init_process_group) | [mindspore.communication.init](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.communication.html#mindspore.communication.init) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/init.html) | | [torch.distributed.new_group](https://pytorch.org/docs/1.8.1/distributed.html#torch.distributed.new_group) | [mindspore.communication.create_group](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.communication.html#mindspore.communication.create_group) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/create_group.html) | ### torch.nn | PyTorch 1.8.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.nn.AdaptiveAvgPool2d](https://pytorch.org/docs/1.8.1/generated/torch.nn.AdaptiveAvgPool2d.html) | [mindspore.nn.AdaptiveAvgPool2d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.AdaptiveAvgPool2d.html) | Difference comparison is under development. | | [torch.nn.AvgPool1d](https://pytorch.org/docs/1.8.1/generated/torch.nn.AvgPool1d.html) | [mindspore.nn.AvgPool1d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.AvgPool1d.html) | Difference comparison is under development. | | [torch.nn.AvgPool2d](https://pytorch.org/docs/1.8.1/generated/torch.nn.AvgPool2d.html) | [mindspore.nn.AvgPool2d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.AvgPool2d.html) | Difference comparison is under development. | | [torch.nn.AvgPool3d](https://pytorch.org/docs/1.8.1/generated/torch.nn.AvgPool3d.html) | [mindspore.nn.AvgPool3d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.AvgPool3d.html) | Difference comparison is under development.| | [torch.nn.BCEWithLogitsLoss](https://pytorch.org/docs/1.8.1/generated/torch.nn.BCEWithLogitsLoss.html) | [mindspore.nn.BCEWithLogitsLoss](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.BCEWithLogitsLoss.html) | Difference comparison is under development. | | [torch.nn.BatchNorm1d](https://pytorch.org/docs/1.8.1/generated/torch.nn.BatchNorm1d.html) | [mindspore.nn.BatchNorm1d](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.BatchNorm1d.html) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/BatchNorm1d.html) | | [torch.nn.BatchNorm2d](https://pytorch.org/docs/1.8.1/generated/torch.nn.BatchNorm2d.html) | [mindspore.nn.BatchNorm2d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.BatchNorm2d.html) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/BatchNorm2d.html) | | [torch.nn.CTCLoss](https://pytorch.org/docs/1.8.1/generated/torch.nn.CTCLoss.html) | [mindspore.nn.CTCLoss](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.CTCLoss.html) |The functions are consistent. | | [torch.nn.Conv1d](https://pytorch.org/docs/1.8.1/generated/torch.nn.Conv1d.html) | [mindspore.nn.Conv1d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Conv1d.html) | Difference comparison is under development. | | [torch.nn.Conv2d](https://pytorch.org/docs/1.8.1/generated/torch.nn.Conv2d.html) | [mindspore.nn.Conv2d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Conv2d.html) | Difference comparison is under development. | | [torch.nn.Conv3d](https://pytorch.org/docs/1.8.1/generated/torch.nn.Conv3d.html) | [mindspore.nn.Conv3d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Conv3d.html) | Difference comparison is under development. | | [torch.nn.ConvTranspose1d](https://pytorch.org/docs/1.8.1/generated/torch.nn.ConvTranspose1d.html) | [mindspore.nn.Conv1dTranspose](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Conv1dTranspose.html) | Difference comparison is under development. | | [torch.nn.ConvTranspose2d](https://pytorch.org/docs/1.8.1/generated/torch.nn.ConvTranspose2d.html) | [mindspore.nn.Conv2dTranspose](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Conv2dTranspose.html) | Difference comparison is under development. | | [torch.nn.ConvTranspose3d](https://pytorch.org/docs/1.8.1/generated/torch.nn.ConvTranspose3d.html) | [mindspore.nn.Conv3dTranspose](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Conv3dTranspose.html) | Difference comparison is under development. | | [torch.nn.CosineEmbeddingLoss](https://pytorch.org/docs/1.8.1/generated/torch.nn.CosineEmbeddingLoss.html) | [mindspore.nn.CosineEmbeddingLoss](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.CosineEmbeddingLoss.html) | Difference comparison is under development. | | [torch.nn.CrossEntropyLoss](https://pytorch.org/docs/1.8.1/generated/torch.nn.CrossEntropyLoss.html) | [mindspore.nn.CrossEntropyLoss](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.CrossEntropyLoss.html) | Difference comparison is under development. | | [torch.nn.Dropout](https://pytorch.org/docs/1.8.1/generated/torch.nn.Dropout.html) | [mindspore.nn.Dropout](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Dropout.html#mindspore.nn.Dropout) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Dropout.html) | | [torch.nn.Dropout](https://pytorch.org/docs/1.8.1/generated/torch.nn.Dropout.html) | [mindspore.ops.dropout](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.dropout.html) | Difference comparison is under development. | | [torch.nn.FractionalMaxPool2d](https://pytorch.org/docs/1.8.1/generated/torch.nn.FractionalMaxPool2d.html) | [mindspore.nn.FractionalMaxPool2d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.FractionalMaxPool2d.html) | The functions are consistent.| | [torch.nn.GELU](https://pytorch.org/docs/1.8.1/generated/torch.nn.GELU.html) | [mindspore.nn.GELU](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.GELU.html) | Difference comparison is under development. | | [torch.nn.GRU](https://pytorch.org/docs/1.8.1/generated/torch.nn.GRU.html#torch.nn.GRU) | [mindspore.nn.GRU](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.GRU.html) | Difference comparison is under development. | | [torch.nn.GroupNorm](https://pytorch.org/docs/1.8.1/generated/torch.nn.GroupNorm.html) | [mindspore.nn.GroupNorm](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.GroupNorm.html) | Difference comparison is under development. | | [torch.nn.Hardshrink](https://pytorch.org/docs/1.8.1/generated/torch.nn.Hardshrink.html#torch.nn.Hardshrink) | [mindspore.nn.HShrink](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.HShrink.html) | Difference comparison is under development. | | [torch.nn.L1Loss](https://pytorch.org/docs/1.8.1/generated/torch.nn.L1Loss.html#torch.nn.L1Loss) | [mindspore.nn.L1Loss](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.L1Loss.html) | Difference comparison is under development. | | [torch.nn.LPPool1d](https://pytorch.org/docs/1.8.1/generated/torch.nn.LPPool1d.html) | [mindspore.nn.LPPool1d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.LPPool1d.html) | Difference comparison is under development.| | [torch.nn.LPPool2d](https://pytorch.org/docs/1.8.1/generated/torch.nn.LPPool2d.html) | [mindspore.nn.LPPool2d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.LPPool2d.html) | Difference comparison is under development.| | [torch.nn.LSTM](https://pytorch.org/docs/1.8.1/generated/torch.nn.LSTM.html) | [mindspore.nn.LSTM](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.LSTM.html) | Difference comparison is under development. | | [torch.nn.LSTMCell](https://pytorch.org/docs/1.8.1/generated/torch.nn.LSTMCell.html?torch.nn.LSTMCell) | [mindspore.nn.LSTMCell](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.LSTMCell.html) |Difference comparison is under development. | | [torch.nn.LayerNorm](https://pytorch.org/docs/1.8.1/generated/torch.nn.LayerNorm.html) | [mindspore.nn.LayerNorm](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.LayerNorm.html) |Difference comparison is under development. | | [torch.nn.LeakyReLU](https://pytorch.org/docs/1.8.1/generated/torch.nn.LeakyReLU.html)| [mindspore.nn.LeakyReLU](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.LeakyReLU.html) | Difference comparison is under development. | | [torch.nn.Linear](https://pytorch.org/docs/1.8.1/generated/torch.nn.Linear.html) | [mindspore.nn.Dense](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Dense.html) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Dense.html) | | [torch.nn.MSELoss](https://pytorch.org/docs/1.8.1/generated/torch.nn.MSELoss.html) | [mindspore.nn.MSELoss](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.MSELoss.html) | Difference comparison is under development. | | [torch.nn.MarginRankingLoss](https://pytorch.org/docs/1.8.1/generated/torch.nn.MarginRankingLoss.html) | [mindspore.nn.MarginRankingLoss](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.MarginRankingLoss.html) | Difference comparison is under development.| | [torch.nn.MaxPool1d](https://pytorch.org/docs/1.8.1/generated/torch.nn.MaxPool1d.html) | [mindspore.nn.MaxPool1d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.MaxPool1d.html) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/MaxPool1d.html) | | [torch.nn.MaxPool2d](https://pytorch.org/docs/1.8.1/generated/torch.nn.MaxPool2d.html) | [mindspore.nn.MaxPool2d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.MaxPool2d.html) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/MaxPool2d.html) | | [torch.nn.MaxPool3d](https://pytorch.org/docs/1.8.1/generated/torch.nn.MaxPool3d.html) | [mindspore.nn.MaxPool3d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.MaxPool3d.html) | The functions are consistent.| | [torch.nn.PReLU](https://pytorch.org/docs/1.8.1/generated/torch.nn.PReLU.html) | [mindspore.nn.PReLU](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.PReLU.html) | Difference comparison is under development. | | [torch.nn.PixelShuffle](https://pytorch.org/docs/1.8.1/generated/torch.nn.PixelShuffle.html) | [mindspore.nn.PixelShuffle](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.PixelShuffle.html) | The functions are consistent.| | [torch.nn.PixelUnshuffle](https://pytorch.org/docs/1.8.1/generated/torch.nn.PixelUnshuffle.html) | [mindspore.nn.PixelUnshuffle](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.PixelUnshuffle.html) | The functions are consistent.| | [torch.nn.ReLU](https://pytorch.org/docs/1.8.1/generated/torch.nn.ReLU.html) | [mindspore.nn.ReLU](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.ReLU.html) | Difference comparison is under development. | | [torch.nn.Sigmoid](https://pytorch.org/docs/1.8.1/generated/torch.nn.Sigmoid.html) | [mindspore.nn.Sigmoid](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Sigmoid.html) | Difference comparison is under development. | | [torch.nn.SmoothL1Loss](https://pytorch.org/docs/1.8.1/generated/torch.nn.SmoothL1Loss.html) | [mindspore.nn.SmoothL1Loss](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.SmoothL1Loss.html) | Difference comparison is under development. | | [torch.nn.Softmax](https://pytorch.org/docs/1.8.1/generated/torch.nn.Softmax.html) | [mindspore.nn.Softmax]( https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Softmax.html) |Difference comparison is under development. | | [torch.nn.Softshrink](https://pytorch.org/docs/1.8.1/generated/torch.nn.Softshrink.html) | [mindspore.nn.SoftShrink](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.SoftShrink.html) | Difference comparison is under development. | | [torch.nn.Tanh](https://pytorch.org/docs/1.8.1/generated/torch.nn.Tanh.html) | [mindspore.nn.Tanh](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Tanh.html) | Difference comparison is under development. | | [torch.nn.Unfold](https://pytorch.org/docs/1.8.1/generated/torch.nn.Unfold.html) | [mindspore.nn.Unfold](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Unfold.html) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Unfold.html) | ### torch.nn.functional | PyTorch 1.8.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.nn.functional.binary_cross_entropy](https://pytorch.org/docs/1.8.1/nn.functional.html#binary-cross-entropy) | [mindspore.nn.BCELoss](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.BCELoss.html) | Difference comparison is under development. | | [torch.nn.functional.elu](https://pytorch.org/docs/1.8.1/nn.functional.html#elu) | [mindspore.ops.elu](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.elu.html) | Difference comparison is under development. | | [torch.nn.functional.l1_loss](https://pytorch.org/docs/1.8.1/nn.functional.html#l1-loss) | [mindspore.nn.L1Loss](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.L1Loss.html) | Difference comparison is under development. | | [torch.nn.functional.lp_pool1d](https://pytorch.org/docs/1.8.1/nn.functional.html#lp-pool1d) | [mindspore.ops.lp_pool1d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.lp_pool1d.html) | Difference comparison is under development.| | [torch.nn.functional.lp_pool2d](https://pytorch.org/docs/1.8.1/nn.functional.html#lp-pool2d) | [mindspore.ops.lp_pool2d](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.lp_pool2d.html) | Difference comparison is under development.| | [torch.nn.functional.margin_ranking_loss](https://pytorch.org/docs/1.8.1/nn.functional.html#margin-ranking-loss) | [mindspore.ops.margin_ranking_loss](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.margin_ranking_loss.html) | Difference comparison is under development.| | [torch.nn.functional.mse_loss](https://pytorch.org/docs/1.8.1/nn.functional.html#mse-loss) | [mindspore.nn.MSELoss](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.MSELoss.html) | Difference comparison is under development. | | [torch.nn.functional.pad](https://pytorch.org/docs/1.8.1/nn.functional.html#pad) | [mindspore.ops.pad](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.pad.html) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/pad.html) | | [torch.nn.functional.pixel_shuffle](https://pytorch.org/docs/1.8.1/nn.functional.html#pixel-shuffle) | [mindspore.ops.pixel_shuffle](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.pixel_shuffle.html) | The functions are consistent, but the parameter names are inconsistent.| | [torch.nn.functional.pixel_unshuffle](https://pytorch.org/docs/1.8.1/nn.functional.html#pixel-unshuffle) | [mindspore.ops.pixel_unshuffle](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.pixel_unshuffle.html) | The functions are consistent, but the parameter names are inconsistent.| | [torch.nn.functional.soft_margin_loss](https://pytorch.org/docs/1.8.1/nn.functional.html#soft-margin-loss) | [mindspore.nn.SoftMarginLoss](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.SoftMarginLoss.html) | Difference comparison is under development. | ### torch.Tensor | PyTorch 1.8.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ |---------------------------------------------| | [torch.Tensor.addbmm](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.addbmm) | [mindspore.Tensor.addbmm](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.addbmm.html) | The functions are consistent.| | [torch.Tensor.addmm](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.addmm) | [mindspore.Tensor.addmm](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.addmm.html) | The functions are consistent.| | [torch.Tensor.arccosh](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.arccosh) | [mindspore.Tensor.arccosh](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.arccosh.html) | The functions are consistent. | | [torch.Tensor.angle](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.angle) | [mindspore.Tensor.angle](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.angle.html) | The functions are consistent. | | [torch.Tensor.arcsin](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.arcsin) | [mindspore.Tensor.arcsin](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.arcsin.html) | The functions are consistent. | | [torch.Tensor.arcsinh](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.arcsinh) | [mindspore.Tensor.arcsinh](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.arcsinh.html) | Difference comparison is under development. | | [torch.Tensor.arctan](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.arctan) | [mindspore.Tensor.arctan](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.arctan.html) | The functions are consistent. | | [torch.Tensor.arctanh](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.arctanh) | [mindspore.Tensor.arctanh](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.arctanh.html) | Difference comparison is under development. | | [torch.Tensor.copysign](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.copysign) | [mindspore.Tensor.copysign](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.copysign.html) | The functions are consistent. | | [torch.Tensor.deg2rad](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.deg2rad) | [mindspore.Tensor.deg2rad](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.deg2rad.html) | The functions are consistent. | | [torch.Tensor.divide](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.divide) | [mindspore.Tensor.divide](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.divide.html) | The functions are consistent. | | [torch.Tensor.flip](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.flip) | [mindspore.Tensor.flip](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.flip.html) | Difference comparison is under development. | | [torch.Tensor.fliplr](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.fliplr) | [mindspore.Tensor.fliplr](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.fliplr.html) | Difference comparison is under development. | | [torch.Tensor.flipud](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.flipud) | [mindspore.Tensor.flipud](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.flipud.html) | Difference comparison is under development. | | [torch.Tensor.is_floating_point](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.is_floating_point) | [mindspore.Tensor.is_floating_point](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.is_floating_point.html) | Difference comparison is under development. | | [torch.Tensor.is_signed](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.is_signed) | [mindspore.Tensor.is_signed](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.is_signed.html) | Difference comparison is under development. | | [torch.Tensor.lcm](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.lcm) | [mindspore.Tensor.lcm](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.lcm.html) | The functions are consistent. | | [torch.Tensor.ldexp](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.ldexp) | [mindspore.Tensor.ldexp](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.ldexp.html) | The functions are consistent. | | [torch.Tensor.logaddexp](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.logaddexp) | [mindspore.Tensor.logaddexp](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.logaddexp.html) | The functions are consistent. | | [torch.Tensor.logaddexp2](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.logaddexp2) | [mindspore.Tensor.logaddexp2](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.logaddexp2.html) | The functions are consistent. | | [torch.Tensor.logsumexp](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.logsumexp) | [mindspore.Tensor.logsumexp](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.logsumexp.html) | The functions are consistent. | | [torch.Tensor.negative](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.negative) | [mindspore.Tensor.negative](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.negative.html) | The functions are consistent. | | [torch.Tensor.nelement](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.nelement) | [mindspore.Tensor.nelement](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.nelement.html) | The functions are consistent. | | [torch.Tensor.numel](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.numel) | [mindspore.Tensor.numel](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.numel.html) | The functions are consistent. | | [torch.Tensor.permute](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.permute) | [mindspore.Tensor.permute](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.permute.html) | The functions are consistent. | | [torch.Tensor.remainder](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.remainder) | [mindspore.Tensor.remainder](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.remainder.html) | The functions are consistent. | | [torch.Tensor.rad2deg](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.rad2deg) | [mindspore.Tensor.rad2deg](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.rad2deg.html) | The functions are consistent. | | [torch.Tensor.repeat_interleave](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.repeat_interleave) | [mindspore.Tensor.repeat_interleave](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.repeat_interleave.html) | Difference comparison is under development. | | [torch.Tensor.reshape_as](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.reshape_as) | [mindspore.Tensor.reshape_as](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.reshape_as.html) | Difference comparison is under development. | | [torch.Tensor.roll](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.roll) | [mindspore.Tensor.roll](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.roll.html) | Difference comparison is under development. | | [torch.Tensor.rot90](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.rot90) | [mindspore.Tensor.rot90](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.rot90.html) | Difference comparison is under development. | | [torch.Tensor.short](https://pytorch.org/docs/1.8.1/tensors.html#torch.Tensor.short) | [mindspore.Tensor.short](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.short.html) | Difference comparison is under development. | ### torch.optim | PyTorch 1.8.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | [torch.optim.lr_scheduler.CosineAnnealingLR](https://pytorch.org/docs/1.8.1/optim.html#torch.optim.lr_scheduler.CosineAnnealingLR) | [mindspore.nn.cosine_decay_lr](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.cosine_decay_lr.html#mindspore.nn.cosine_decay_lr) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/CosineDecayLr.html) | | [torch.optim.lr_scheduler.ExponentialLR](https://pytorch.org/docs/1.8.1/optim.html#torch.optim.lr_scheduler.ExponentialLR) | [mindspore.nn.exponential_decay_lr](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.exponential_decay_lr.html#mindspore.nn.exponential_decay_lr) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/ExponentialDecayLR.html) | | [torch.optim.lr_scheduler.MultiStepLR](https://pytorch.org/docs/1.8.1/optim.html#torch.optim.lr_scheduler.MultiStepLR) | [mindspore.nn.piecewise_constant_lr](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.piecewise_constant_lr.html#mindspore.nn.piecewise_constant_lr) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/PiecewiseConstantLR.html) | | [torch.optim.lr_scheduler.StepLR](https://pytorch.org/docs/1.8.1/optim.html#torch.optim.lr_scheduler.StepLR) | [mindspore.nn.piecewise_constant_lr](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.piecewise_constant_lr.html#mindspore.nn.piecewise_constant_lr) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/PiecewiseConstantLR.html) | ### torch.utils | PyTorch 1.8.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.utils.data.DataLoader](https://pytorch.org/docs/1.8.1/data.html#torch.utils.data.DataLoader) | None | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/DataLoader.html) | | [torch.utils.data.Dataset](https://pytorch.org/docs/1.8.1/data.html#torch.utils.data.Dataset) | [mindspore.dataset.GeneratorDataset](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.GeneratorDataset.html#mindspore.dataset.GeneratorDataset) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/GeneratorDataset.html) | | [torch.utils.data.distributed.DistributedSampler](https://pytorch.org/docs/1.8.1/data.html#torch.utils.data.distributed.DistributedSampler) | [mindspore.dataset.DistributedSampler](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.DistributedSampler.html#mindspore.dataset.DistributedSampler) | | | [torch.utils.data.RandomSampler](https://pytorch.org/docs/1.8.1/data.html#torch.utils.data.RandomSampler) | [mindspore.dataset.RandomSampler](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.RandomSampler.html#mindspore.dataset.RandomSampler) | | | [torch.utils.data.SequentialSampler](https://pytorch.org/docs/1.8.1/data.html#torch.utils.data.SequentialSampler) | [mindspore.dataset.SequentialSampler](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.SequentialSampler.html#mindspore.dataset.SequentialSampler) | | | [torch.utils.data.SubsetRandomSampler](https://pytorch.org/docs/1.8.1/data.html#torch.utils.data.SubsetRandomSampler) | [mindspore.dataset.SubsetRandomSampler](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.SubsetRandomSampler.html#mindspore.dataset.SubsetRandomSampler) | | | [torch.utils.data.WeightedRandomSampler](https://pytorch.org/docs/1.8.1/data.html#torch.utils.data.WeightedRandomSampler) | [mindspore.dataset.WeightedRandomSampler](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.WeightedRandomSampler.html#mindspore.dataset.WeightedRandomSampler) | | ## PyTorch 1.5.0 ### torch | PyTorch 1.5.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.arange](https://pytorch.org/docs/1.5.0/torch.html#torch.arange) | [mindspore.numpy.arange](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.arange.html#mindspore.numpy.arange) | | | [torch.argmax](https://pytorch.org/docs/1.5.0/torch.html#torch.argmax) | [mindspore.ops.argmax](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.argmax.html#mindspore.ops.argmax) | | | [torch.argmin](https://pytorch.org/docs/1.5.0/torch.html#torch.argmin) | [mindspore.ops.argmin](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.argmin.html#mindspore.ops.argmin) | | | [torch.argsort](https://pytorch.org/docs/1.5.0/torch.html#torch.argsort) | [mindspore.ops.Sort](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Sort.html#mindspore.ops.Sort) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Sort.html) | | [torch.bincount](https://pytorch.org/docs/1.5.0/torch.html#torch.bincount) | [mindspore.numpy.bincount](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.bincount.html#mindspore.numpy.bincount) | | | [torch.broadcast_tensors](https://pytorch.org/docs/1.5.0/torch.html#torch.broadcast_tensors) | [mindspore.ops.BroadcastTo](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.BroadcastTo.html#mindspore.ops.BroadcastTo) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/BroadcastTo.html) | | [torch.chunk](https://pytorch.org/docs/1.5.0/torch.html#torch.chunk) | [mindspore.ops.Split](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Split.html#mindspore.ops.Split) | | | [torch.diagflat](https://pytorch.org/docs/1.5.0/torch.html#torch.diagflat) | [mindspore.numpy.diagflat](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.diagflat.html#mindspore.numpy.diagflat) | | | [torch.diagonal](https://pytorch.org/docs/1.5.0/torch.html#torch.diagonal) | [mindspore.numpy.diagonal](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.diagonal.html#mindspore.numpy.diagonal) | | | [torch.dot](https://pytorch.org/docs/1.5.0/torch.html#torch.dot) | [mindspore.ops.tensor_dot](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.tensor_dot.html#mindspore.ops.tensor_dot) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/tensor_dot.html) | | [torch.flatten](https://pytorch.org/docs/1.5.0/torch.html#torch.flatten) | [mindspore.ops.Flatten](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Flatten.html#mindspore.ops.Flatten) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Flatten.html) | | [torch.flip](https://pytorch.org/docs/1.5.0/torch.html#torch.flip) | [mindspore.ops.ReverseV2](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ReverseV2.html#mindspore.ops.ReverseV2) | | | [torch.floor](https://pytorch.org/docs/1.5.0/torch.html#torch.floor) | [mindspore.ops.Floor](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Floor.html#mindspore.ops.Floor) | | | [torch.floor_divide](https://pytorch.org/docs/1.5.0/torch.html#torch.floor_divide) | [mindspore.ops.FloorDiv](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.FloorDiv.html#mindspore.ops.FloorDiv) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/FloorDiv.html) | | [torch.fmod](https://pytorch.org/docs/1.5.0/torch.html#torch.fmod) | [mindspore.ops.Mod](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Mod.html#mindspore.ops.Mod) | | | [torch.from_numpy](https://pytorch.org/docs/1.5.0/torch.html#torch.from_numpy) | [mindspore.Tensor.from_numpy](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.from_numpy.html#mindspore.Tensor.from_numpy) | | | [torch.gather](https://pytorch.org/docs/1.5.0/torch.html#torch.gather) | [mindspore.ops.GatherD](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.GatherD.html#mindspore.ops.GatherD) | | | [torch.ge](https://pytorch.org/docs/1.5.0/torch.html#torch.ge) | [mindspore.ops.GreaterEqual](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.GreaterEqual.html#mindspore.ops.GreaterEqual) | | | [torch.gt](https://pytorch.org/docs/1.5.0/torch.html#torch.gt) | [mindspore.ops.Greater](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Greater.html#mindspore.ops.Greater) | | | [torch.hamming_window](https://pytorch.org/docs/1.5.0/torch.html#torch.hamming_window) | [mindspore.numpy.hamming](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.hamming.html#mindspore.numpy.hamming) | | | [torch.histc](https://pytorch.org/docs/1.5.0/torch.html#torch.histc) | [mindspore.ops.HistogramFixedWidth](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.HistogramFixedWidth.html#mindspore.ops.HistogramFixedWidth) | | | [torch.imag](https://pytorch.org/docs/1.5.0/torch.html#torch.imag) | [mindspore.ops.Imag](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Imag.html#mindspore.ops.Imag) | | | [torch.isfinite](https://pytorch.org/docs/1.5.0/torch.html#torch.isfinite) | [mindspore.ops.IsFinite](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.IsFinite.html#mindspore.ops.IsFinite) | | | [torch.isinf](https://pytorch.org/docs/1.5.0/torch.html#torch.isinf) | [mindspore.ops.IsInf](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.IsInf.html#mindspore.ops.IsInf) | | | [torch.isnan](https://pytorch.org/docs/1.5.0/torch.html#torch.isnan) | [mindspore.ops.IsNan](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.IsNan.html#mindspore.ops.IsNan) | | | [torch.le](https://pytorch.org/docs/1.5.0/torch.html#torch.le) | [mindspore.ops.LessEqual](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.LessEqual.html#mindspore.ops.LessEqual) | | | [torch.lerp](https://pytorch.org/docs/1.5.0/torch.html#torch.lerp) | [mindspore.ops.Lerp](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Lerp.html#mindspore.ops.Lerp) | | | [torch.linspace](https://pytorch.org/docs/1.5.0/torch.html#torch.linspace) | [mindspore.ops.LinSpace](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.LinSpace.html#mindspore.ops.LinSpace) | | | [torch.load](https://pytorch.org/docs/1.5.0/torch.html#torch.load) | [mindspore.load_checkpoint](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.load_checkpoint.html#mindspore-load-checkpoint) | | | [torch.log](https://pytorch.org/docs/1.5.0/torch.html#torch.log) | [mindspore.ops.Log](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Log.html#mindspore.ops.Log) | | | [torch.log1p](https://pytorch.org/docs/1.5.0/torch.html#torch.log1p) | [mindspore.ops.Log1p](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Log1p.html#mindspore.ops.Log1p) | | | [torch.log2](https://pytorch.org/docs/1.5.0/torch.html#torch.log2) | [mindspore.numpy.log2](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.log2.html#mindspore.numpy.log2) | | | [torch.logical_and](https://pytorch.org/docs/1.5.0/torch.html#torch.logical_and) | [mindspore.ops.LogicalAnd](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.LogicalAnd.html#mindspore.ops.LogicalAnd) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/LogicalAnd.html) | | [torch.logical_not](https://pytorch.org/docs/1.5.0/torch.html#torch.logical_not) | [mindspore.numpy.logical_not](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.logical_not.html#mindspore.numpy.logical_not) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/logical_not.html) | | [torch.logical_or](https://pytorch.org/docs/1.5.0/torch.html#torch.logical_or) | [mindspore.ops.LogicalOr](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.LogicalOr.html#mindspore.ops.LogicalOr) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/LogicalOr.html) | | [torch.logical_xor](https://pytorch.org/docs/1.5.0/torch.html#torch.logical_xor) | [mindspore.numpy.logical_xor](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.logical_xor.html#mindspore.numpy.logical_xor) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/logical_xor.html) | | [torch.logspace](https://pytorch.org/docs/1.5.0/torch.html#torch.logspace) | [mindspore.numpy.logspace](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.logspace.html#mindspore.numpy.logspace) | | | [torch.lt](https://pytorch.org/docs/1.5.0/torch.html#torch.lt) | [mindspore.ops.Less](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Less.html#mindspore.ops.Less) | | | [torch.matmul](https://pytorch.org/docs/1.5.0/torch.html#torch.matmul) | [mindspore.ops.MatMul](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.MatMul.html#mindspore.ops.MatMul) | | | [torch.matrix_power](https://pytorch.org/docs/1.5.0/torch.html#torch.matrix_power) | [mindspore.numpy.matrix_power](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.matrix_power.html#mindspore.numpy.matrix_power) | | | [torch.matrix_rank](https://pytorch.org/docs/1.5.0/torch.html#torch.matrix_rank) | [mindspore.ops.Rank](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Rank.html#mindspore.ops.Rank) | | | [torch.max](https://pytorch.org/docs/1.5.0/torch.html#torch.max) | [mindspore.ops.ArgMaxWithValue](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ArgMaxWithValue.html#mindspore.ops.ArgMaxWithValue) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/ArgMaxWithValue.html) | | [torch.mean](https://pytorch.org/docs/1.5.0/torch.html#torch.mean) | [mindspore.ops.ReduceMean](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ReduceMean.html#mindspore.ops.ReduceMean) | | | [torch.meshgrid](https://pytorch.org/docs/1.5.0/torch.html#torch.meshgrid) | [mindspore.ops.Meshgrid](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Meshgrid.html#mindspore.ops.Meshgrid) | | | [torch.min](https://pytorch.org/docs/1.5.0/torch.html#torch.min) | [mindspore.ops.ArgMinWithValue](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ArgMinWithValue.html#mindspore.ops.ArgMinWithValue) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/ArgMinWithValue.html) | | [torch.mm](https://pytorch.org/docs/1.5.0/torch.html#torch.mm) | [mindspore.ops.MatMul](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.MatMul.html#mindspore.ops.MatMul) | | | [torch.mul](https://pytorch.org/docs/1.5.0/torch.html#torch.mul) | [mindspore.ops.Mul](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Mul.html#mindspore.ops.Mul) | | | [torch.multinomial](https://pytorch.org/docs/1.5.0/torch.html#torch.multinomial) | [mindspore.ops.multinomial](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.multinomial.html#mindspore.ops.multinomial) | | | [torch.ne](https://pytorch.org/docs/1.5.0/torch.html#torch.ne) | [mindspore.ops.NotEqual](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.NotEqual.html#mindspore.ops.NotEqual) | | | [torch.neg](https://pytorch.org/docs/1.5.0/torch.html#torch.neg) | [mindspore.ops.Neg](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Neg.html#mindspore.ops.Neg) | | | [torch.norm](https://pytorch.org/docs/1.5.0/torch.html#torch.norm) | [mindspore.ops.LpNorm](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.LpNorm.html#mindspore.ops.LpNorm) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/LpNorm.html) | | [torch.numel](https://pytorch.org/docs/1.5.0/torch.html#torch.numel) | [mindspore.ops.Size](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Size.html#mindspore.ops.Size) | | | [torch.ones](https://pytorch.org/docs/1.5.0/torch.html#torch.ones) | [mindspore.ops.Ones](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Ones.html#mindspore.ops.Ones) | | | [torch.ones_like](https://pytorch.org/docs/1.5.0/torch.html#torch.ones_like) | [mindspore.ops.OnesLike](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.OnesLike.html#mindspore.ops.OnesLike) | | | [torch.pow](https://pytorch.org/docs/1.5.0/torch.html#torch.pow) | [mindspore.ops.Pow](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Pow.html#mindspore.ops.Pow) | | | [torch.prod](https://pytorch.org/docs/1.5.0/torch.html#torch.prod) | [mindspore.ops.ReduceProd](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ReduceProd.html#mindspore.ops.ReduceProd) | | | [torch.promote_types](https://pytorch.org/docs/1.5.0/torch.html#torch.promote_types) | [mindspore.numpy.promote_types](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.promote_types.html#mindspore.numpy.promote_types) | | | [torch.rand](https://pytorch.org/docs/1.5.0/torch.html#torch.rand) | [mindspore.ops.UniformReal](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.UniformReal.html#mindspore.ops.UniformReal) | | | [torch.rand_like](https://pytorch.org/docs/1.5.0/torch.html#torch.rand_like) | [mindspore.ops.UniformReal](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.UniformReal.html#mindspore.ops.UniformReal) | | | [torch.randint](https://pytorch.org/docs/1.5.0/torch.html#torch.randint) | [mindspore.ops.UniformInt](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.UniformInt.html#mindspore.ops.UniformInt) | | | [torch.randint_like](https://pytorch.org/docs/1.5.0/torch.html#torch.randint_like) | [mindspore.ops.UniformInt](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.UniformInt.html#mindspore.ops.UniformInt) | | | [torch.randn](https://pytorch.org/docs/1.5.0/torch.html#torch.randn) | [mindspore.ops.StandardNormal](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.StandardNormal.html#mindspore.ops.StandardNormal) | | | [torch.randperm](https://pytorch.org/docs/1.5.0/torch.html#torch.randperm) | [mindspore.ops.Randperm](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Randperm.html#mindspore.ops.Randperm) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Randperm.html) | | [torch.real](https://pytorch.org/docs/1.5.0/torch.html#torch.real) | [mindspore.ops.Real](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Real.html#mindspore.ops.Real) | | | [torch.reciprocal](https://pytorch.org/docs/1.5.0/torch.html#torch.reciprocal) | [mindspore.ops.Reciprocal](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Reciprocal.html#mindspore.ops.Reciprocal) | | | [torch.remainder](https://pytorch.org/docs/1.5.0/torch.html#torch.remainder) | [mindspore.numpy.remainder](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.remainder.html#mindspore.numpy.remainder) | | | [torch.reshape](https://pytorch.org/docs/1.5.0/torch.html#torch.reshape) | [mindspore.ops.Reshape](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Reshape.html#mindspore.ops.Reshape) | | | [torch.result_type](https://pytorch.org/docs/1.5.0/torch.html#torch.result_type) | [mindspore.numpy.result_type](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.result_type.html#mindspore.numpy.result_type) | | | [torch.rot90](https://pytorch.org/docs/1.5.0/torch.html#torch.rot90) | [mindspore.numpy.rot90](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.rot90.html#mindspore.numpy.rot90) | | | [torch.round](https://pytorch.org/docs/1.5.0/torch.html#torch.round) | [mindspore.ops.Rint](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Rint.html#mindspore.ops.Rint) | | | [torch.rsqrt](https://pytorch.org/docs/1.5.0/torch.html#torch.rsqrt) | [mindspore.ops.Rsqrt](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Rsqrt.html#mindspore.ops.Rsqrt) | | | [torch.save](https://pytorch.org/docs/1.5.0/torch.html#torch.save) | [mindspore.save_checkpoint](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.save_checkpoint.html#mindspore.save_checkpoint) | | | [torch.sigmoid](https://pytorch.org/docs/1.5.0/torch.html#torch.sigmoid) | [mindspore.ops.Sigmoid](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Sigmoid.html#mindspore.ops.Sigmoid) | | | [torch.sin](https://pytorch.org/docs/1.5.0/torch.html#torch.sin) | [mindspore.ops.Sin](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Sin.html#mindspore.ops.Sin) | | | [torch.sinh](https://pytorch.org/docs/1.5.0/torch.html#torch.sinh) | [mindspore.ops.Sinh](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Sinh.html#mindspore.ops.Sinh) | | | [torch.sort](https://pytorch.org/docs/1.5.0/torch.html#torch.sort) | [mindspore.ops.Sort](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Sort.html#mindspore.ops.Sort) | | | [torch.sparse_coo_tensor](https://pytorch.org/docs/1.5.0/torch.html#torch.sparse_coo_tensor) | [mindspore.SparseTensor](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.SparseTensor.html#mindspore.SparseTensor) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/SparseTensor.html) | | [torch.split](https://pytorch.org/docs/1.5.0/torch.html#torch.split) | [mindspore.ops.Split](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Split.html#mindspore.ops.Split) | | | [torch.sqrt](https://pytorch.org/docs/1.5.0/torch.html#torch.sqrt) | [mindspore.ops.Sqrt](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Sqrt.html#mindspore.ops.Sqrt) | | | [torch.square](https://pytorch.org/docs/1.5.0/torch.html#torch.square) | [mindspore.ops.Square](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Square.html#mindspore.ops.Square) | | | [torch.squeeze](https://pytorch.org/docs/1.5.0/torch.html#torch.squeeze) | [mindspore.ops.Squeeze](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Squeeze.html#mindspore.ops.Squeeze) | | | [torch.stack](https://pytorch.org/docs/1.5.0/torch.html#torch.stack) | [mindspore.ops.Stack](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Stack.html#mindspore.ops.Stack) | | | [torch.std](https://pytorch.org/docs/1.5.0/torch.html#torch.std) | [mindspore.Tensor.std](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.std.html#mindspore.Tensor.std) | | | [torch.std_mean](https://pytorch.org/docs/1.5.0/torch.html#torch.std_mean) | [mindspore.ops.ReduceMean](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ReduceMean.html#mindspore.ops.ReduceMean) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/ReduceMean&std_mean.html) | | [torch.sum](https://pytorch.org/docs/1.5.0/torch.html#torch.sum) | [mindspore.ops.ReduceSum](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ReduceSum.html#mindspore.ops.ReduceSum) | | | [torch.take](https://pytorch.org/docs/1.5.0/torch.html#torch.take) | [mindspore.Tensor.take](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.take.html#mindspore.Tensor.take) | | | [torch.tan](https://pytorch.org/docs/1.5.0/torch.html#torch.tan) | [mindspore.ops.Tan](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Tan.html#mindspore.ops.Tan) | | | [torch.tanh](https://pytorch.org/docs/1.5.0/torch.html#torch.tanh) | [mindspore.ops.Tanh](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Tanh.html#mindspore.ops.Tanh) | | | [torch.tensor](https://pytorch.org/docs/1.5.0/torch.html#torch.tensor) | [mindspore.Tensor](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.Tensor.html#mindspore.Tensor) | | | [torch.Tensor](https://pytorch.org/docs/1.5.0/torch.html#torch.Tensor) | [mindspore.Tensor](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.Tensor.html#mindspore.Tensor) | | | [torch.tensordot](https://pytorch.org/docs/1.5.0/torch.html#torch.tensordot) | [mindspore.numpy.tensordot](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.tensordot.html) | | | [torch.topk](https://pytorch.org/docs/1.5.0/torch.html#torch.topk) | [mindspore.ops.TopK](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.TopK.html#mindspore.ops.TopK) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/TopK.html) | | [torch.trace](https://pytorch.org/docs/1.5.0/torch.html#torch.trace) | [mindspore.Tensor.trace](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.trace.html#mindspore.Tensor.trace) | | | [torch.transpose](https://pytorch.org/docs/1.5.0/torch.html#torch.transpose) | [mindspore.Tensor.transpose](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.transpose.html) |Difference comparison is under development. | | [torch.trapz](https://pytorch.org/docs/1.5.0/torch.html#torch.trapz) | [mindspore.numpy.trapz](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.trapz.html#mindspore.numpy.trapz) | | | [torch.tril_indices](https://pytorch.org/docs/1.5.0/torch.html#torch.tril_indices) | [mindspore.numpy.tril_indices](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.tril_indices.html#mindspore.numpy.tril_indices) | | | [torch.triu_indices](https://pytorch.org/docs/1.5.0/torch.html#torch.triu_indices) | [mindspore.numpy.triu_indices](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.triu_indices.html#mindspore.numpy.triu_indices) | | | [torch.true_divide](https://pytorch.org/docs/1.5.0/torch.html#torch.true_divide) | [mindspore.numpy.true_divide](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.true_divide.html#mindspore.numpy.true_divide) | | | [torch.trunc](https://pytorch.org/docs/1.5.0/torch.html#torch.trunc) | [mindspore.numpy.trunc](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.trunc.html#mindspore.numpy.trunc) | | | [torch.unbind](https://pytorch.org/docs/1.5.0/torch.html#torch.unbind) | [mindspore.ops.Unstack](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Unstack.html#mindspore.ops.Unstack) | | | [torch.unique](https://pytorch.org/docs/1.5.0/torch.html#torch.unique) | [mindspore.ops.Unique](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Unique.html#mindspore.ops.Unique) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Unique.html) | | [torch.var](https://pytorch.org/docs/1.5.0/torch.html#torch.var) | [mindspore.Tensor.var](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.var.html#mindspore.Tensor.var) | | | [torch.where](https://pytorch.org/docs/1.5.0/torch.html#torch.where) | [mindspore.numpy.where](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.where.html#mindspore.numpy.where) | | | [torch.zeros](https://pytorch.org/docs/1.5.0/torch.html#torch.zeros) | [mindspore.ops.Zeros](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Zeros.html#mindspore.ops.Zeros) | | | [torch.zeros_like](https://pytorch.org/docs/1.5.0/torch.html#torch.zeros_like) | [mindspore.ops.ZerosLike](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ZerosLike.html#mindspore.ops.ZerosLike) | | ### torch.autograd | PyTorch 1.5.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.autograd.backward](https://pytorch.org/docs/1.5.0/autograd.html#torch.autograd.backward) | [mindspore.grad](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.grad.html#mindspore.grad) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/grad.html) | | [torch.autograd.enable_grad](https://pytorch.org/docs/1.5.0/autograd.html#torch.autograd.enable_grad) | [mindspore.ops.stop_gradient](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.stop_gradient.html) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/stop_gradient.html) | | [torch.autograd.grad](https://pytorch.org/docs/1.5.0/autograd.html#torch.autograd.grad) | [mindspore.grad](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.grad.html) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/grad.html) | | [torch.autograd.no_grad](https://pytorch.org/docs/1.5.0/autograd.html#torch.autograd.no_grad) | [mindspore.ops.stop_gradient](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.stop_gradient.html) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/stop_gradient.html) | | [torch.autograd.variable](https://pytorch.org/docs/1.5.0/autograd.html#variable-deprecated) | [mindspore.Parameter](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.Parameter.html#mindspore.Parameter) | | ### torch.cuda | PyTorch 1.5.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.cuda.device_count](https://pytorch.org/docs/1.5.0/cuda.html#torch.cuda.device_count) | [mindspore.communication.get_group_size](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.communication.html#mindspore.communication.get_group_size) | | | [torch.cuda.set_device](https://pytorch.org/docs/1.5.0/cuda.html#torch.cuda.set_device) | [mindspore.set_context](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.set_context.html#mindspore.set_context) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/set_context.html) | ### torch.distributions | PyTorch 1.5.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------ | | [torch.distributions.gamma.Gamma](https://pytorch.org/docs/1.5.0/distributions.html#torch.distributions.gamma.Gamma) | [mindspore.ops.Gamma](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Gamma.html#mindspore.ops.Gamma) | | ### torch.nn | PyTorch 1.5.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.nn.Embedding](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Embedding) | [mindspore.nn.Embedding](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Embedding.html#mindspore.nn.Embedding) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/nn_Embedding.html) | | [torch.nn.Flatten](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Flatten) | [mindspore.nn.Flatten](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Flatten.html#mindspore.nn.Flatten) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/nn_Flatten.html) | | [torch.nn.GELU](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.GELU) | [mindspore.nn.FastGelu](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.FastGelu.html#mindspore.nn.FastGelu) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/FastGelu.html) | | [torch.nn.KLDivLoss](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.KLDivLoss) | [mindspore.ops.KLDivLoss](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.KLDivLoss.html#mindspore.ops.KLDivLoss) | | | [torch.nn.MaxPool3d](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.MaxPool3d) | [mindspore.ops.MaxPool3D](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.MaxPool3D.html#mindspore.ops.MaxPool3D) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/MaxPool3D.html) | | [torch.nn.MultiheadAttention](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.MultiheadAttention) | [mindspore.nn.transformer.MultiHeadAttention](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.nn.transformer.html#mindspore.nn.transformer.MultiHeadAttention) | Difference comparison is under development. | | [torch.nn.Module](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Module) | [mindspore.nn.Cell](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Cell.html#mindspore.nn.Cell) | | | [torch.nn.Module.add_module](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Module.add_module) | [mindspore.nn.Cell.insert_child_to_cell](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Cell.html#mindspore.nn.Cell.insert_child_to_cell) | | | [torch.nn.Module.children](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Module.children) | [mindspore.nn.Cell.cells](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Cell.html#mindspore.nn.Cell.cells) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Cells.html) | | [torch.nn.Module.load_state_dict](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Module.load_state_dict) | [mindspore.load_param_into_net](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.load_param_into_net.html#mindspore.load_param_into_net) | | | [torch.nn.Module.named_children](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Module.named_children) | [mindspore.nn.Cell.name_cells](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Cell.html#mindspore.nn.Cell.name_cells) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/NameCells.html) | | [torch.nn.Module.named_modules](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Module.named_modules) | [mindspore.nn.Cell.cells_and_names](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Cell.html#mindspore.nn.Cell.cells_and_names) | | | [torch.nn.Module.state_dict](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Module.state_dict) | [mindspore.nn.Cell.parameters_dict](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Cell.html#mindspore.nn.Cell.parameters_dict) | | | [torch.nn.Module.train](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Module.train) | [mindspore.nn.Cell.set_train](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Cell.html#mindspore.nn.Cell.set_train) | | | [torch.nn.ModuleList](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.ModuleList) | [mindspore.nn.CellList](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.CellList.html#mindspore.nn.CellList) | | | [torch.nn.NLLLoss](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.NLLLoss) | [mindspore.ops.NLLLoss](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.NLLLoss.html#mindspore.ops.NLLLoss) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/NLLLoss.html) | | [torch.nn.Parameter](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Parameter) | [mindspore.Parameter](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.Parameter.html#mindspore.Parameter) | | | [torch.nn.ParameterList](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.ParameterList) | [mindspore.ParameterTuple](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.ParameterTuple.html#mindspore.ParameterTuple) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/ParameterTuple.html)| | [torch.nn.ReplicationPad2d](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.ReplicationPad2d) | [mindspore.nn.Pad](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Pad.html#mindspore.nn.Pad) | | | [torch.nn.SELU](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.SELU) | [mindspore.ops.SeLU](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.SeLU.html#mindspore.ops.SeLU) | | | [torch.nn.Sequential](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Sequential) | [mindspore.nn.SequentialCell](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.SequentialCell.html#mindspore.nn.SequentialCell) | | | [torch.nn.SyncBatchNorm.convert_sync_batchnorm](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.SyncBatchNorm.convert_sync_batchnorm) | [mindspore.nn.SyncBatchNorm](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.SyncBatchNorm.html#mindspore.nn.SyncBatchNorm) | | | [torch.nn.Transformer](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Transformer) | [mindspore.nn.transformer.Transformer](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.nn.transformer.html#mindspore.nn.transformer.Transformer) | Difference comparison is under development. | | [torch.nn.TransformerEncoder](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.TransformerEncoder) | [mindspore.nn.transformer.TransformerEncoder](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.nn.transformer.html#mindspore.nn.transformer.TransformerEncoder) | | | [torch.nn.TransformerDecoder](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.TransformerDecoder) | [mindspore.nn.transformer.TransformerDecoder](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.nn.transformer.html#mindspore.nn.transformer.TransformerDecoder) |Difference comparison is under development. | | [torch.nn.TransformerEncoderLayer](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.TransformerEncoderLayer) | [mindspore.nn.transformer.TransformerEncoderLayer](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.nn.transformer.html#mindspore.nn.transformer.TransformerEncoderLayer) | Difference comparison is under development.| | [torch.nn.TransformerDecoderLayer](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.TransformerDecoderLayer) | [mindspore.nn.transformer.TransformerDecoderLayer](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.nn.transformer.html#mindspore.nn.transformer.TransformerDecoderLayer) |Difference comparison is under development. | | [torch.nn.Upsample](https://pytorch.org/docs/1.5.0/nn.html#torch.nn.Upsample) | [mindspore.nn.ResizeBilinear](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.ResizeBilinear.html#mindspore.nn.ResizeBilinear) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/ResizeBilinear.html) | ### torch.nn.functional | PyTorch 1.5.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.nn.functional.adaptive_avg_pool2d](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.adaptive_avg_pool2d) | [mindspore.nn.AdaptiveAvgPool2d](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.AdaptiveAvgPool2d.html#mindspore.nn.AdaptiveAvgPool2d) | | | [torch.nn.functional.avg_pool1d](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.avg_pool1d) | [mindspore.nn.AvgPool1d](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.AvgPool1d.html#mindspore.nn.AvgPool1d) | | | [torch.nn.functional.avg_pool2d](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.avg_pool2d) | [mindspore.ops.AvgPool](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.AvgPool.html#mindspore.ops.AvgPool) | | | [torch.nn.functional.avg_pool3d](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.avg_pool3d) | [mindspore.ops.AvgPool3D](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.AvgPool3D.html#mindspore.ops.AvgPool3D) | | | [torch.nn.functional.batch_norm](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.batch_norm) | [mindspore.ops.BatchNorm](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.BatchNorm.html#mindspore.ops.BatchNorm) | | | [torch.nn.functional.conv2d](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.conv2d) | [mindspore.ops.Conv2D](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Conv2D.html#mindspore.ops.Conv2D) | | | [torch.nn.functional.cosine_embedding_loss](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.cosine_embedding_loss) | [mindspore.nn.CosineEmbeddingLoss](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.CosineEmbeddingLoss.html#mindspore.nn.CosineEmbeddingLoss) | | | [torch.nn.functional.ctc_loss](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.ctc_loss) | [mindspore.ops.CTCLoss](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.CTCLoss.html#mindspore.ops.CTCLoss) | | | [torch.nn.functional.kl_div](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.kl_div) | [mindspore.ops.KLDivLoss](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.KLDivLoss.html#mindspore.ops.KLDivLoss) | | | [torch.nn.functional.layer_norm](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.layer_norm) | [mindspore.ops.LayerNorm](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.LayerNorm.html#mindspore.ops.LayerNorm) | | | [torch.nn.functional.leaky_relu](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.leaky_relu) | [mindspore.nn.LeakyReLU](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.LeakyReLU.html#mindspore.nn.LeakyReLU) | | | [torch.nn.functional.log_softmax](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.log_softmax) | [mindspore.nn.LogSoftmax](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.LogSoftmax.html#mindspore.nn.LogSoftmax) | | | [torch.nn.functional.normalize](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.normalize) | [mindspore.ops.L2Normalize](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.L2Normalize.html#mindspore.ops.L2Normalize) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/L2Normalize.html) | | [torch.nn.functional.one_hot](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.one_hot) | [mindspore.ops.OneHot](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.OneHot.html#mindspore.ops.OneHot) | | | [torch.nn.functional.relu](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.relu) | [mindspore.ops.ReLU](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ReLU.html#mindspore.ops.ReLU) | | | [torch.nn.functional.smooth_l1_loss](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.smooth_l1_loss) | [mindspore.nn.SmoothL1Loss](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.SmoothL1Loss.html#mindspore.nn.SmoothL1Loss) | | | [torch.nn.functional.softmax](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.softmax) | [mindspore.ops.Softmax](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Softmax.html#mindspore.ops.Softmax) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Softmax.html) | | [torch.nn.functional.softplus](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.softplus) | [mindspore.ops.Softplus](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Softplus.html#mindspore.ops.Softplus) | | | [torch.nn.functional.softsign](https://pytorch.org/docs/1.5.0/nn.functional.html#torch.nn.functional.softsign) | [mindspore.ops.Softsign](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Softsign.html#mindspore.ops.Softsign) | | ### torch.nn.init | PyTorch 1.5.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.nn.init.constant_](https://pytorch.org/docs/1.5.0/nn.init.html#torch.nn.init.constant_) | [mindspore.common.initializer.Constant](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.common.initializer.html#mindspore.common.initializer.Constant) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Constant.html) | | [torch.nn.init.kaiming_normal_](https://pytorch.org/docs/1.5.0/nn.init.html#torch.nn.init.kaiming_normal_) | [mindspore.common.initializer.HeNormal](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.common.initializer.html#mindspore.common.initializer.HeNormal) | | | [torch.nn.init.kaiming_uniform_](https://pytorch.org/docs/1.5.0/nn.init.html#torch.nn.init.kaiming_uniform_) | [mindspore.common.initializer.HeUniform](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.common.initializer.html#mindspore.common.initializer.HeUniform) | | | [torch.nn.init.normal_](https://pytorch.org/docs/1.5.0/nn.init.html#torch.nn.init.normal_) | [mindspore.common.initializer.Normal](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.common.initializer.html#mindspore.common.initializer.Normal) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/InitNormal.html) | | [torch.nn.init.ones_](https://pytorch.org/docs/1.5.0/nn.init.html#torch.nn.init.ones_) | [mindspore.common.initializer.One](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.common.initializer.html#mindspore.common.initializer.One) | | | [torch.nn.init.xavier_uniform_](https://pytorch.org/docs/1.5.0/nn.init.html#torch.nn.init.xavier_uniform_) | [mindspore.common.initializer.XavierUniform](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.common.initializer.html#mindspore.common.initializer.XavierUniform) | | | [torch.nn.init.zeros_](https://pytorch.org/docs/1.5.0/nn.init.html#torch.nn.init.zeros_) | [mindspore.common.initializer.Zero](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.common.initializer.html#mindspore.common.initializer.Zero) | | | [torch.nn.init.uniform_](https://pytorch.org/docs/1.5.0/nn.init.html#torch.nn.init.uniform_) | [mindspore.common.initializer.Uniform](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore.common.initializer.html#mindspore.common.initializer.Uniform) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Uniform.html) | ### torch.optim | PyTorch 1.5.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.optim.Adadelta](https://pytorch.org/docs/1.5.0/optim.html#torch.optim.Adadelta) | [mindspore.ops.ApplyAdadelta](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ApplyAdadelta.html#mindspore.ops.ApplyAdadelta) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/ApplyAdadelta.html) | | [torch.optim.Adagrad](https://pytorch.org/docs/1.5.0/optim.html#torch.optim.Adagrad) | [mindspore.nn.Adagrad](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Adagrad.html#mindspore.nn.Adagrad) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Adagrad.html) | | [torch.optim.Adam](https://pytorch.org/docs/1.5.0/optim.html#torch.optim.Adam) | [mindspore.nn.Adam](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Adam.html#mindspore.nn.Adam) | | | [torch.optim.Adamax](https://pytorch.org/docs/1.5.0/optim.html#torch.optim.Adamax) | [mindspore.ops.ApplyAdaMax](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ApplyAdaMax.html#mindspore.ops.ApplyAdaMax) | | | [torch.optim.AdamW](https://pytorch.org/docs/1.5.0/optim.html#torch.optim.AdamW) | [mindspore.nn.AdamWeightDecay](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.AdamWeightDecay.html#mindspore.nn.AdamWeightDecay) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/AdamWeightDecay.html) | | [torch.optim.Optimizer](https://pytorch.org/docs/1.5.0/optim.html#torch.optim.Optimizer) | [mindspore.nn.Optimizer](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Optimizer.html#mindspore.nn.Optimizer) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Optimizer.html) | | [torch.optim.Optimizer.step](https://pytorch.org/docs/1.5.0/optim.html#torch.optim.Optimizer.step) | [mindspore.nn.TrainOneStepCell](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.TrainOneStepCell.html#mindspore.nn.TrainOneStepCell) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/TrainOneStepCell.html) | | [torch.optim.RMSprop](https://pytorch.org/docs/1.5.0/optim.html#torch.optim.RMSprop) | [mindspore.nn.RMSProp](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.RMSProp.html#mindspore.nn.RMSProp) | | | [torch.optim.SGD](https://pytorch.org/docs/1.5.0/optim.html#torch.optim.SGD) | [mindspore.nn.SGD](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.SGD.html#mindspore.nn.SGD) | | ### torch.Tensor | PyTorch 1.5.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.BoolTensor.all](https://pytorch.org/docs/1.5.0/tensors.html#torch.BoolTensor.all) | [mindspore.Tensor.all](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.all.html#mindspore.Tensor.all) | | | [torch.BoolTensor.any](https://pytorch.org/docs/1.5.0/tensors.html#torch.BoolTensor.any) | [mindspore.Tensor.any](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.any.html#mindspore.Tensor.any) | | | [torch.Tensor.abs](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.abs) | [mindspore.Tensor.abs](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.abs.html#mindspore.Tensor.abs) | | | [torch.Tensor.argmax](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.argmax) | [mindspore.Tensor.argmax](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.argmax.html#mindspore.Tensor.argmax) | | | [torch.Tensor.argmin](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.argmin) | [mindspore.Tensor.argmin](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.argmin.html#mindspore.Tensor.argmin) | | | [torch.Tensor.chunk](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.chunk) | [mindspore.ops.Split](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Split.html#mindspore.ops.Split) | | | [torch.Tensor.copy_](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.copy_) | [mindspore.Tensor.copy](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.copy.html#mindspore.Tensor.copy) | | | [torch.Tensor.cuda](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.cuda) | [mindspore.set_context](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.set_context.html#mindspore.set_context) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/cuda.html) | | [torch.Tensor.cumsum](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.cumsum) | [mindspore.Tensor.cumsum](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.cumsum.html#mindspore.Tensor.cumsum) | | | [torch.Tensor.diagonal](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.diagonal) | [mindspore.Tensor.diagonal](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.diagonal.html#mindspore.Tensor.diagonal) | | | [torch.Tensor.dtype](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.dtype) | [mindspore.Tensor.dtype](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.dtype.html#mindspore.Tensor.dtype) | | | [torch.Tensor.expand](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.expand) | [mindspore.ops.BroadcastTo](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.BroadcastTo.html#mindspore.ops.BroadcastTo) | | | [torch.Tensor.expand_as](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.expand_as) | [mindspore.Tensor.expand_as](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.expand_as.html#mindspore.Tensor.expand_as) | | | [torch.Tensor.fill_](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.fill_) | [mindspore.ops.Fill](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Fill.html#mindspore.ops.Fill) | | | [torch.Tensor.flatten](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.flatten) | [mindspore.Tensor.flatten](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.flatten.html#mindspore.Tensor.flatten) | | | [torch.Tensor.float](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.float) | [mindspore.ops.Cast](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Cast.html#mindspore.ops.Cast) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Cast.html) | | [torch.Tensor.index_add](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.index_add) | [mindspore.ops.InplaceAdd](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.InplaceAdd.html#mindspore.ops.InplaceAdd) | | | [torch.Tensor.item](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.item) | [mindspore.Tensor.item](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.item.html#mindspore.Tensor.item) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/item.html) | | [torch.Tensor.max](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.max) | [mindspore.Tensor.max](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.max.html#mindspore.Tensor.max) | | | [torch.Tensor.mean](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.mean) | [mindspore.Tensor.mean](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.mean.html#mindspore.Tensor.mean) | | | [torch.Tensor.min](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.min) | [mindspore.Tensor.min](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.min.html#mindspore.Tensor.min) | | | [torch.Tensor.mm](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.mm) | [mindspore.ops.MatMul](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.MatMul.html#mindspore.ops.MatMul) | | | [torch.Tensor.mul](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.mul) | [mindspore.ops.Mul](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Mul.html#mindspore.ops.Mul) | | | [torch.Tensor.ndim](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.ndim) | [mindspore.Tensor.ndim](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.ndim.html#mindspore.Tensor.ndim) | | | [torch.Tensor.new_full](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.new_full) | [mindspore.numpy.full](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.full.html#mindspore.numpy.full) | | | [torch.Tensor.new_zeros](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.new_zeros) | [mindspore.ops.Zeros](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Zeros.html#mindspore.ops.Zeros) | | | [torch.Tensor.numpy](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.numpy) | [mindspore.Tensor.asnumpy](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.asnumpy.html#mindspore.Tensor.asnumpy) | | | [torch.Tensor.pow](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.pow) | [mindspore.ops.Pow](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Pow.html#mindspore.ops.Pow) | | | [torch.Tensor.permute](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.permute) | [mindspore.ops.Transpose](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Transpose.html#mindspore.ops.Transpose) | | | [torch.Tensor.repeat](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.repeat) | [mindspore.numpy.tile](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/numpy/mindspore.numpy.tile.html#mindspore.numpy.tile) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/npTile.html) | | [torch.Tensor.requires_grad_](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.requires_grad_) | [mindspore.Parameter.requires_grad](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.Parameter.html#mindspore.Parameter.requires_grad) | | | [torch.Tensor.reshape_as](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.reshape_as) | [mindspore.Tensor.reshape](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.reshape.html#mindspore.Tensor.reshape) | | | [torch.Tensor.resize_](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.resize_) | [mindspore.Tensor.resize](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.resize.html#mindspore.Tensor.resize) | | | [torch.Tensor.round](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.round) | [mindspore.ops.Round](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Round.html#mindspore.ops.Round) | | | [torch.Tensor.scatter_add_](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.scatter_add_) | [mindspore.ops.ScatterNdAdd](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ScatterNdAdd.html#mindspore.ops.ScatterNdAdd) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/ScatterNdAdd.html) | | [torch.Tensor.sigmoid](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.sigmoid) | [mindspore.nn.Sigmoid](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/nn/mindspore.nn.Sigmoid.html#mindspore.nn.Sigmoid) | | | [torch.Tensor.sign](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.sign) | [mindspore.ops.Sign](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Sign.html#mindspore.ops.Sign) | | | [torch.Tensor.size](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.size) | [mindspore.Tensor.shape](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.shape.html#mindspore.Tensor.shape) | | | [torch.Tensor.sqrt](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.sqrt) | [mindspore.ops.Sqrt](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Sqrt.html#mindspore.ops.Sqrt) | | | [torch.Tensor.stride](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.stride) | [mindspore.Tensor.strides](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.strides.html#mindspore.Tensor.strides) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/stride.html) | | [torch.Tensor.squeeze](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.squeeze) | [mindspore.Tensor.squeeze](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.squeeze.html#mindspore.Tensor.squeeze) | | | [torch.Tensor.sub](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.sub) | [mindspore.ops.Sub](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Sub.html#mindspore.ops.Sub) | | | [torch.Tensor.sum](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.sum) | [mindspore.Tensor.sum](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.sum.html#mindspore.Tensor.sum) | Difference comparison is under development. | | [torch.Tensor.t](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.t) | [mindspore.ops.Transpose](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.Transpose.html#mindspore.ops.Transpose) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Transpose.html) | | [torch.Tensor.t](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.t) | [mindspore.Tensor.T](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.T.html#mindspore.Tensor.T) | | | [torch.Tensor.transpose](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.transpose) | [mindspore.Tensor.transpose](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.transpose.html#mindspore.Tensor.transpose) | | | [torch.Tensor.unsqueeze](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.unsqueeze) | [mindspore.ops.ExpandDims](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ExpandDims.html#mindspore.ops.ExpandDims) | | | [torch.Tensor.view](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.view) | [mindspore.Tensor.view](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.view.html#mindspore.Tensor.view) | | | [torch.Tensor.view_as](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.view_as) | [mindspore.Tensor.view](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/Tensor/mindspore.Tensor.view.html#mindspore.Tensor.view) | | | [torch.Tensor.zero_](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.zero_) | [mindspore.ops.ZerosLike](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ZerosLike.html#mindspore.ops.ZerosLike) | | ## torchtext | TorchText 0.10.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torchtext.data.functional.custom_replace](https://pytorch.org/text/0.10.0/data_functional.html#custom-replace) | [mindspore.dataset.text.RegexReplace](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_text/mindspore.dataset.text.RegexReplace.html#mindspore.dataset.text.RegexReplace) | | | [torchtext.data.functional.load_sp_model](https://pytorch.org/text/0.10.0/data_functional.html#load-sp-model) | [mindspore.dataset.text.SentencePieceVocab](https://www.mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_text/mindspore.dataset.text.SentencePieceVocab.html#mindspore.dataset.text.SentencePieceVocab) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/SentencePieceVocab.html) | | [torchtext.data.functional.numericalize_tokens_from_iterator](https://pytorch.org/text/0.10.0/data_functional.html#numericalize-tokens-from-iterator) | [mindspore.dataset.text.Lookup](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_text/mindspore.dataset.text.Lookup.html#mindspore.dataset.text.Lookup) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Lookup.html) | | [torchtext.data.functional.sentencepiece_numericalizer](https://pytorch.org/text/0.10.0/data_functional.html#sentencepiece-numericalizer) | [mindspore.dataset.text.SentencePieceTokenizer](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_text/mindspore.dataset.text.SentencePieceTokenizer.html#mindspore.dataset.text.SentencePieceTokenizer) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/SentencePieceTokenizer_Out_INT.html) | | [torchtext.data.functional.sentencepiece_tokenizer](https://pytorch.org/text/0.10.0/data_functional.html#sentencepiece-tokenizer) | [mindspore.dataset.text.SentencePieceTokenizer](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_text/mindspore.dataset.text.SentencePieceTokenizer.html#mindspore.dataset.text.SentencePieceTokenizer) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/SentencePieceTokenizer_Out_STRING.html) | | [torchtext.data.functional.simple_space_split](https://pytorch.org/text/0.10.0/data_functional.html#simple-space-split) | [mindspore.dataset.text.WhitespaceTokenizer](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_text/mindspore.dataset.text.WhitespaceTokenizer.html#mindspore.dataset.text.WhitespaceTokenizer) | | | [torchtext.data.utils.ngrams_iterator](https://pytorch.org/text/0.10.0/data_utils.html#ngrams-iterator) | [mindspore.dataset.text.Ngram](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_text/mindspore.dataset.text.Ngram.html#mindspore.dataset.text.Ngram) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/Ngram.html) | ## torchvision | TorchVision 0.10.0 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torchvision.datasets.CelebA](https://pytorch.org/vision/0.10/datasets.html#torchvision.datasets.CelebA) | [mindspore.dataset.CelebADataset](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.CelebADataset.html#mindspore.dataset.CelebADataset) | | | [torchvision.datasets.CIFAR10](https://pytorch.org/vision/0.10/datasets.html#torchvision.datasets.CIFAR10) | [mindspore.dataset.Cifar10Dataset](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.Cifar10Dataset.html#mindspore.dataset.Cifar10Dataset) | | | [torchvision.datasets.CIFAR100](https://pytorch.org/vision/0.10/datasets.html#torchvision.datasets.CIFAR100) | [mindspore.dataset.Cifar100Dataset](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.Cifar100Dataset.html#mindspore.dataset.Cifar100Dataset) | | | [torchvision.datasets.CocoDetection](https://pytorch.org/vision/0.10/datasets.html#torchvision.datasets.CocoDetection) | [mindspore.dataset.CocoDataset](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.CocoDataset.html#mindspore.dataset.CocoDataset) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/CocoDataset.html) | | [torchvision.datasets.ImageFolder](https://pytorch.org/vision/0.10/datasets.html#torchvision.datasets.ImageFolder) | [mindspore.dataset.ImageFolderDataset](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.ImageFolderDataset.html#mindspore.dataset.ImageFolderDataset) | | | [torchvision.datasets.MNIST](https://pytorch.org/vision/0.10/datasets.html#torchvision.datasets.MNIST) | [mindspore.dataset.MnistDataset](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.MnistDataset.html#mindspore.dataset.MnistDataset) | | | [torchvision.datasets.VOCDetection](https://pytorch.org/vision/0.10/datasets.html#torchvision.datasets.VOCDetection) | [mindspore.dataset.VOCDataset](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.VOCDataset.html#mindspore.dataset.VOCDataset) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/VOCDetection.html) | | [torchvision.datasets.VOCSegmentation](https://pytorch.org/vision/0.10/datasets.html#torchvision.datasets.VOCSegmentation) | [mindspore.dataset.VOCDataset](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset/mindspore.dataset.VOCDataset.html#mindspore.dataset.VOCDataset) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/VOCSegmentation.html) | | [torchvision.ops.nms](https://pytorch.org/vision/0.10/ops.html#torchvision.ops.nms) | [mindspore.ops.NMSWithMask](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.NMSWithMask.html#mindspore.ops.NMSWithMask) | | | [torchvision.ops.roi_align](https://pytorch.org/vision/0.10/ops.html#torchvision.ops.roi_align) | [mindspore.ops.ROIAlign](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/ops/mindspore.ops.ROIAlign.html#mindspore.ops.ROIAlign) | | | [torchvision.transforms.CenterCrop](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.CenterCrop) | [mindspore.dataset.vision.CenterCrop](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.CenterCrop.html#mindspore.dataset.vision.CenterCrop) | | | [torchvision.transforms.ColorJitter](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.ColorJitter) | [mindspore.dataset.vision.RandomColorAdjust](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomColorAdjust.html#mindspore.dataset.vision.RandomColorAdjust) | | | [torchvision.transforms.Compose](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.Compose) | [mindspore.dataset.transforms.Compose](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_transforms/mindspore.dataset.transforms.Compose.html#mindspore.dataset.transforms.Compose) | | | [torchvision.transforms.ConvertImageDtype](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.ConvertImageDtype) | [mindspore.dataset.transforms.TypeCast](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_transforms/mindspore.dataset.transforms.TypeCast.html#mindspore.dataset.transforms.TypeCast) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/TypeCast.html) | | [torchvision.transforms.FiveCrop](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.FiveCrop) | [mindspore.dataset.vision.FiveCrop](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.FiveCrop.html#mindspore.dataset.vision.FiveCrop) | | | [torchvision.transforms.GaussianBlur](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.GaussianBlur) | [mindspore.dataset.vision.GaussianBlur](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.GaussianBlur.html#mindspore.dataset.vision.GaussianBlur) | | | [torchvision.transforms.Grayscale](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.Grayscale) | [mindspore.dataset.vision.Grayscale](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.Grayscale.html#mindspore.dataset.vision.Grayscale) | | | [torchvision.transforms.LinearTransformation](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.LinearTransformation) | [mindspore.dataset.vision.LinearTransformation](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.LinearTransformation.html#mindspore.dataset.vision.LinearTransformation) | | | [torchvision.transforms.Normalize](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.Normalize) | [mindspore.dataset.vision.Normalize](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.Normalize.html#mindspore.dataset.vision.Normalize) | | | [torchvision.transforms.Pad](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.Pad) | [mindspore.dataset.vision.Pad](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.Pad.html#mindspore.dataset.vision.Pad) | | | [torchvision.transforms.RandomAffine](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomAffine) | [mindspore.dataset.vision.RandomAffine](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomAffine.html#mindspore.dataset.vision.RandomAffine) | | | [torchvision.transforms.RandomApply](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomApply) | [mindspore.dataset.transforms.RandomApply](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_transforms/mindspore.dataset.transforms.RandomApply.html#mindspore.dataset.transforms.RandomApply) | | | [torchvision.transforms.RandomChoice](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomChoice) | [mindspore.dataset.transforms.RandomChoice](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_transforms/mindspore.dataset.transforms.RandomChoice.html#mindspore.dataset.transforms.RandomChoice) | | | [torchvision.transforms.RandomCrop](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomCrop) | [mindspore.dataset.vision.RandomCrop](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomCrop.html#mindspore.dataset.vision.RandomCrop) | | | [torchvision.transforms.RandomErasing](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomErasing) | [mindspore.dataset.vision.RandomErasing](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomErasing.html#mindspore.dataset.vision.RandomErasing) | | | [torchvision.transforms.RandomGrayscale](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomGrayscale) | [mindspore.dataset.vision.RandomGrayscale](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomGrayscale.html#mindspore.dataset.vision.RandomGrayscale) | | | [torchvision.transforms.RandomHorizontalFlip](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomHorizontalFlip) | [mindspore.dataset.vision.RandomHorizontalFlip](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomHorizontalFlip.html#mindspore.dataset.vision.RandomHorizontalFlip) | | | [torchvision.transforms.RandomOrder](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomOrder) | [mindspore.dataset.transforms.RandomOrder](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_transforms/mindspore.dataset.transforms.RandomOrder.html#mindspore.dataset.transforms.RandomOrder) | | | [torchvision.transforms.RandomPerspective](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomPerspective) | [mindspore.dataset.vision.RandomPerspective](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomPerspective.html#mindspore.dataset.vision.RandomPerspective) | | | [torchvision.transforms.RandomPosterize](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomPosterize) | [mindspore.dataset.vision.RandomPosterize](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomPosterize.html#mindspore.dataset.vision.RandomPosterize) | | | [torchvision.transforms.RandomResizedCrop](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomResizedCrop) | [mindspore.dataset.vision.RandomResizedCrop](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomResizedCrop.html#mindspore.dataset.vision.RandomResizedCrop) | | | [torchvision.transforms.RandomRotation](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomRotation) | [mindspore.dataset.vision.RandomRotation](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomRotation.html#mindspore.dataset.vision.RandomRotation) | | | [torchvision.transforms.RandomSolarize](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomSolarize) | [mindspore.dataset.vision.RandomSolarize](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomSolarize.html#mindspore.dataset.vision.RandomSolarize) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/RandomSolarize.html) | | [torchvision.transforms.RandomVerticalFlip](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.RandomVerticalFlip) | [mindspore.dataset.vision.RandomVerticalFlip](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.RandomVerticalFlip.html#mindspore.dataset.vision.RandomVerticalFlip) | | | [torchvision.transforms.Resize](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.Resize) | [mindspore.dataset.vision.Resize](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.Resize.html#mindspore.dataset.vision.Resize) | | | [torchvision.transforms.TenCrop](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.TenCrop) | [mindspore.dataset.vision.TenCrop](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.TenCrop.html#mindspore.dataset.vision.TenCrop) | | | [torchvision.transforms.ToPILImage](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.ToPILImage) | [mindspore.dataset.vision.ToPIL](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.ToPIL.html#mindspore.dataset.vision.ToPIL) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/ToPIL.html) | | [torchvision.transforms.ToTensor](https://pytorch.org/vision/0.10/transforms.html#torchvision.transforms.ToTensor) | [mindspore.dataset.vision.ToTensor](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/dataset_vision/mindspore.dataset.vision.ToTensor.html#mindspore.dataset.vision.ToTensor) | [diff](https://www.mindspore.cn/docs/en/r2.0.0-alpha/note/api_mapping/pytorch_diff/ToTensor.html) |