# PyTorch and MindSpore API Mapping Table [](https://gitee.com/mindspore/docs/blob/master/docs/mindspore/source_en/note/api_mapping/pytorch_api_mapping.md) Mapping between PyTorch 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. ## API Mapping Consistency Criteria and Exceptions API mapping consistency criteria: consistent API function, consistent number or sequence of parameters, consistent parameter data type, consistent default value, consistent parameter name. Satisfying all the consistency conditions at the same time is considered as consistent API mapping. The API mapping is also consistent in the following exception scenarios: **Exception Scenario 1**: Compared to the API mapping consistency criteria, only the input data types of API parameters are not supported in the same range, including the following 2 sub-scenarios: (1) MindSpore API supports passing parameters of int, float, bool, but does not support passing parameters of small bit-width data types such as int8 or float64. (2) MindSpore API does not support passing parameters of plural type. **Exception Scenario 2**: Compared to MindSpore APIss, the extra parameters of PyTorch API are [general difference parameters](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#general-difference-parameter-table). General difference parameters exist because PyTorch has some parameters that are added for non-functionality such as performance optimization, and the performance optimization mechanism of MindSpore is different from that of PyTorch. **Exception Scenario 3**: If it can be guaranteed that MindSpore API uses the default configuration (or that the user does not configure it), MindSpore API can implement the same functionality as the PyTorch API, and MindSpore API has more parameters than PyTorch API. The functionality is not considered a difference. **Exception Scenario 4**: MindSpore sets the default value of the parameters related to the PyTorch overloading mechanism in the API to None, and the corresponding parameters of the PyTorch counterpart API have no default value. The following is an example of the exception scenario 4. In PyTorch 2.1, torch.argmax has two API overloads in the form of torch.argmax(input) and torch.argmax(input, dim, keepdim=False), respectively, where torch.argmax(input) returns the index of the maximum value element in the input Tensor, and torch.argmax(input, dim, keepdim=False) returns the index of the maximum value of the input Tensor on the specified axis. mindspore.mint.argmax has only one API form, namely mindspore.mint.argmax(input, dim=None, keepdim=False), but mindspore.mint.argmax(input) and torch.argmax(input) have the same function. mindspore.mint.argmax(input, dim, keepdim) and torch.argmax(input, dim, keepdim)have the same function. Compared to torch.argmax, the default value of mindspore.ops.argmax parameter dim is set to None only to adapt the two API overload forms of torch.argmax, so the exception scenario 4 is also considered to be consistent API mapping. ## General Difference Parameter Table Because of the framework mechanism, MindSpore does not provide the following parameters for PyTorch: | Parameter Names | Functions |Descriptions| | :-------------: | :----------------------------------------------------------: |:--:| | out | Indicates the output Tensor |Assign the operation result to the out parameter, not supported in MindSpore.| | layout | Indicates the memory distribution strategy |PyTorch supports torch.striped and torch.split_coo, not supported in MindSpore.| | device | Indicates the Tensor storage location |Including device type and optional device number, MindSpore currently supports operator or network-level device scheduling.| | requires_grad | Indicates whether to update the gradient |MindSpore can be accessed through the `Parameter.requires_grad` attribute to control.| | pin_memory | Indicates whether to use locking page memory |Not supported in MindSpore.| | memory_format | Indicates the memory format of the Tensor |Not supported in MindSpore.| | stable | Indicates whether the sorting is stable |Generally used in the API of Sorting algorithm, not supported in MindSpore.| | sparse_grad | Indicates whether to perform sparsification on the gradient |Not supported in MindSpore.| | size_average | The deprecated parameter in PyTorch |The `reduction` parameter can be used instead.| | reduce | The deprecated parameter in PyTorch |The `reduction` parameter can be used instead.| ## torch | PyTorch 2.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.abs](https://pytorch.org/docs/2.1/generated/torch.abs.html) | [mindspore.mint.abs](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.abs.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.acos](https://pytorch.org/docs/2.1/generated/torch.acos.html) | [mindspore.mint.acos](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.acos.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.acosh](https://pytorch.org/docs/2.1/generated/torch.acosh.html)| [mindspore.mint.acosh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.acosh.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.add](https://pytorch.org/docs/2.1/generated/torch.add.html)| [mindspore.mint.add](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.add.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.addbmm](https://pytorch.org/docs/2.1/generated/torch.addbmm.html)| [mindspore.mint.addbmm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.addbmm.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.addmm](https://pytorch.org/docs/2.1/generated/torch.addmm.html)| [mindspore.mint.addmm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.addmm.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.addmv](https://pytorch.org/docs/2.1/generated/torch.addmv.html)| [mindspore.mint.addmv](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.addmv.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.all](https://pytorch.org/docs/2.1/generated/torch.all.html#torch.all) | [mindspore.mint.all](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.all.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.allclose](https://pytorch.org/docs/2.1/generated/torch.allclose.html)| [mindspore.mint.allclose](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.allclose.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.amax](https://pytorch.org/docs/2.1/generated/torch.amax.html)| [mindspore.mint.amax](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.amax.html)|The functions are consistent, but the default value of dim is different.| | [torch.amin](https://pytorch.org/docs/2.1/generated/torch.amin.html)| [mindspore.mint.amin](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.amin.html)|The functions are consistent, but the default value of dim is different.| | [torch.any](https://pytorch.org/docs/2.1/generated/torch.any.html#torch.any) | [mindspore.mint.any](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.any.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.arange](https://pytorch.org/docs/2.1/generated/torch.arange.html)| [mindspore.mint.arange](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.arange.html)|The functions are consistent, but the default value of end is different.| | [torch.arccos](https://pytorch.org/docs/2.1/generated/torch.arccos.html) | [mindspore.mint.arccos](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.arccos.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.arccosh](https://pytorch.org/docs/2.1/generated/torch.arccosh.html) | [mindspore.mint.arccosh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.arccosh.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.arcsin](https://pytorch.org/docs/2.1/generated/torch.arcsin.html) | [mindspore.mint.arcsin](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.arcsin.html) | Consistent functions, inconsistent parameter names. | | [torch.arcsinh](https://pytorch.org/docs/2.1/generated/torch.arcsinh.html) | [mindspore.mint.arcsinh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.arcsinh.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.arctan](https://pytorch.org/docs/2.1/generated/torch.arctan.html) | [mindspore.mint.arctan](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.arctan.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.arctan2](https://pytorch.org/docs/2.1/generated/torch.arctan2.html)| [mindspore.mint.arctan2](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.arctan2.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.arctanh](https://pytorch.org/docs/2.1/generated/torch.arctanh.html) | [mindspore.mint.arctanh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.arctanh.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.argmax](https://pytorch.org/docs/2.1/generated/torch.argmax.html) | [mindspore.mint.argmax](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.argmax.html) |[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.argmin](https://pytorch.org/docs/2.1/generated/torch.argmin.html) | [mindspore.mint.argmin](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.argmin.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.argsort](https://pytorch.org/docs/2.1/generated/torch.argsort.html)| [mindspore.mint.argsort](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.argsort.html)| [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.asin](https://pytorch.org/docs/2.1/generated/torch.asin.html) | [mindspore.mint.asin](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.asin.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.asinh](https://pytorch.org/docs/2.1/generated/torch.asinh.html)| [mindspore.mint.asinh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.asinh.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.atan](https://pytorch.org/docs/2.1/generated/torch.atan.html) | [mindspore.mint.atan](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.atan.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.atan2](https://pytorch.org/docs/2.1/generated/torch.atan2.html) | [mindspore.mint.atan2](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.atan2.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.atanh](https://pytorch.org/docs/2.1/generated/torch.atanh.html)| [mindspore.mint.atanh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.atanh.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.baddbmm](https://pytorch.org/docs/1.8.1/generated/torch.baddbmm.html) | [mindspore.mint.baddbmm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.baddbmm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.bernoulli](https://pytorch.org/docs/2.1/generated/torch.bernoulli.html)| [mindspore.mint.bernoulli](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.bernoulli.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.bincount](https://pytorch.org/docs/2.1/generated/torch.bincount.html)| [mindspore.mint.bincount](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.bincount.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.bitwise_and](https://pytorch.org/docs/2.1/generated/torch.bitwise_and.html) | [mindspore.mint.bitwise_and](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.bitwise_and.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.bitwise_or](https://pytorch.org/docs/2.1/generated/torch.bitwise_or.html) | [mindspore.mint.bitwise_or](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.bitwise_or.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.bitwise_xor](https://pytorch.org/docs/2.1/generated/torch.bitwise_xor.html) | [mindspore.mint.bitwise_xor](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.bitwise_xor.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.bmm](https://pytorch.org/docs/2.1/generated/torch.bmm.html) | [mindspore.mint.bmm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.bmm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.broadcast_to](https://pytorch.org/docs/2.1/generated/torch.broadcast_to.html) | [mindspore.mint.broadcast_to](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.broadcast_to.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.cat](https://pytorch.org/docs/2.1/generated/torch.cat.html) | [mindspore.mint.cat](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.cat.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.cdist](https://pytorch.org/docs/2.1/generated/torch.cdist.html)| [mindspore.mint.cdist](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.cdist.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.chunk](https://pytorch.org/docs/2.1/generated/torch.chunk.html)| [mindspore.mint.chunk](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.chunk.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.ceil](https://pytorch.org/docs/2.1/generated/torch.ceil.html) | [mindspore.mint.ceil](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.ceil.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.clamp](https://pytorch.org/docs/2.1/generated/torch.clamp.html) | [mindspore.mint.clamp](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.clamp.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.clone](https://pytorch.org/docs/2.1/generated/torch.clone.html)| [mindspore.mint.clone](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.clone.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.concat](https://pytorch.org/docs/2.1/generated/torch.concat.html)| [mindspore.mint.concat](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.concat.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.count_nonzero](https://pytorch.org/docs/2.1/generated/torch.count_nonzero.html)| [mindspore.mint.count_nonzero](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.count_nonzero.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.cos](https://pytorch.org/docs/2.1/generated/torch.cos.html) | [mindspore.mint.cos](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.cos.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.cosh](https://pytorch.org/docs/2.1/generated/torch.cosh.html) | [mindspore.mint.cosh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.cosh.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.cross](https://pytorch.org/docs/2.1/generated/torch.cross.html) | [mindspore.mint.cross](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.cross.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.cummax](https://pytorch.org/docs/2.1/generated/torch.cummax.html) | [mindspore.mint.cummax](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.cummax.html) |[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.cummin](https://pytorch.org/docs/2.1/generated/torch.cummin.html) | [mindspore.mint.cummin](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.cummin.html) |[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.cumprod](https://pytorch.org/docs/2.1/generated/torch.cumprod.html)| [mindspore.mint.cumprod](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.cumprod.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.cumsum](https://pytorch.org/docs/2.1/generated/torch.cumsum.html) | [mindspore.mint.cumsum](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.cumsum.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.diff](https://pytorch.org/docs/2.1/generated/torch.diff.html)| [mindspore.mint.diff](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.diff.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.div](https://pytorch.org/docs/2.1/generated/torch.div.html) | [mindspore.mint.div](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.div.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.divide](https://pytorch.org/docs/2.1/generated/torch.divide.html) | [mindspore.mint.divide](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.divide.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.dot](https://pytorch.org/docs/2.1/generated/torch.dot.html)| [mindspore.mint.dot](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.dot.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.einsum](https://pytorch.org/docs/2.1/generated/torch.einsum.html)| [mindspore.mint.einsum](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.einsum.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.empty](https://pytorch.org/docs/2.1/generated/torch.empty.html)| [mindspore.mint.empty](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.empty.html)| [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.empty_like](https://pytorch.org/docs/2.1/generated/torch.empty_like.html)| [mindspore.mint.empty_like](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.empty_like.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.equal](https://pytorch.org/docs/2.1/generated/torch.equal.html)| [mindspore.mint.equal](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.equal.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.eq](https://pytorch.org/docs/2.1/generated/torch.eq.html) | [mindspore.mint.eq](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.eq.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.erf](https://pytorch.org/docs/2.1/generated/torch.erf.html) | [mindspore.mint.erf](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.erf.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.erfc](https://pytorch.org/docs/2.1/generated/torch.erfc.html) | [mindspore.mint.erfc](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.erfc.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.erfinv](https://pytorch.org/docs/2.1/generated/torch.erfinv.html) | [mindspore.mint.erfinv](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.erfinv.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.exp](https://pytorch.org/docs/2.1/generated/torch.exp.html) | [mindspore.mint.exp](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.exp.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.exp2](https://pytorch.org/docs/2.1/generated/torch.exp2.html) | [mindspore.mint.exp2](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.exp2.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.expm1](https://pytorch.org/docs/2.1/generated/torch.expm1.html) | [mindspore.mint.expm1](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.expm1.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.eye](https://pytorch.org/docs/2.1/generated/torch.eye.html) | [mindspore.mint.eye](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.eye.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.float_power](https://pytorch.org/docs/2.1/generated/torch.float_power.html)| [mindspore.mint.float_power](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.float_power.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.flatten](https://pytorch.org/docs/2.1/generated/torch.flatten.html) | [mindspore.mint.flatten](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.flatten.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.flip](https://pytorch.org/docs/2.1/generated/torch.flip.html) | [mindspore.mint.flip](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.flip.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.floor](https://pytorch.org/docs/2.1/generated/torch.floor.html) | [mindspore.mint.floor](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.floor.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.fmod](https://pytorch.org/docs/2.1/generated/torch.fmod.html)| [mindspore.mint.fmod](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.fmod.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.frac](https://pytorch.org/docs/2.1/generated/torch.frac.html)| [mindspore.mint.frac](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.frac.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.full](https://pytorch.org/docs/2.1/generated/torch.full.html) | [mindspore.mint.full](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.full.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.full_like](https://pytorch.org/docs/2.1/generated/torch.full_like.html)| [mindspore.mint.full_like](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.full_like.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.gather](https://pytorch.org/docs/2.1/generated/torch.gather.html)| [mindspore.mint.gather](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.gather.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.greater](https://pytorch.org/docs/2.1/generated/torch.greater.html) | [mindspore.mint.greater](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.greater.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.greater_equal](https://pytorch.org/docs/2.1/generated/torch.greater_equal.html) | [mindspore.mint.greater_equal](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.greater_equal.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.gt](https://pytorch.org/docs/2.1/generated/torch.gt.html) | [mindspore.mint.gt](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.gt.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.histc](https://pytorch.org/docs/2.1/generated/torch.histc.html)| [mindspore.mint.histc](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.histc.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.index_select](https://pytorch.org/docs/2.1/generated/torch.index_select.html) | [mindspore.mint.index_select](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.index_select.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.inverse](https://pytorch.org/docs/2.1/generated/torch.inverse.html) | [mindspore.mint.inverse](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.inverse.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.isclose](https://pytorch.org/docs/2.1/generated/torch.isclose.html) | [mindspore.mint.isclose](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.isclose.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.isfinite](https://pytorch.org/docs/2.1/generated/torch.isfinite.html) | [mindspore.mint.isfinite](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.isfinite.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.isinf](https://pytorch.org/docs/2.1/generated/torch.isinf.html)| [mindspore.mint.isinf](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.isinf.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.isneginf](https://pytorch.org/docs/2.1/generated/torch.isneginf.html)| [mindspore.mint.isneginf](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.isneginf.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.le](https://pytorch.org/docs/2.1/generated/torch.le.html) | [mindspore.mint.le](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.le.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.lerp](https://pytorch.org/docs/2.1/generated/torch.lerp.html)| [mindspore.mint.lerp](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.lerp.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.less](https://pytorch.org/docs/2.1/generated/torch.less.html) | [mindspore.mint.less](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.less.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.less_equal](https://pytorch.org/docs/2.1/generated/torch.less_equal.html) | [mindspore.mint.less_equal](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.less_equal.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.linspace](https://pytorch.org/docs/2.1/generated/torch.linspace.html) | [mindspore.mint.linspace](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.linspace.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.log](https://pytorch.org/docs/2.1/generated/torch.log.html) | [mindspore.mint.log](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.log.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.log2](https://pytorch.org/docs/2.1/generated/torch.log2.html)| [mindspore.mint.log2](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.log2.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.log10](https://pytorch.org/docs/2.1/generated/torch.log10.html)| [mindspore.mint.log10](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.log10.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.logaddexp](https://pytorch.org/docs/2.1/generated/torch.logaddexp.html)| [mindspore.mint.logaddexp](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.logaddexp.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.logsumexp](https://pytorch.org/docs/2.1/generated/torch.logsumexp.html)| [mindspore.mint.logsumexp](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.logsumexp.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.log1p](https://pytorch.org/docs/2.1/generated/torch.log1p.html#torch.log1p) | [mindspore.mint.log1p](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.log1p.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.logical_and](https://pytorch.org/docs/2.1/generated/torch.logical_and.html) | [mindspore.mint.logical_and](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.logical_and.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.logical_not](https://pytorch.org/docs/2.1/generated/torch.logical_not.html) | [mindspore.mint.logical_not](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.logical_not.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.logical_or](https://pytorch.org/docs/2.1/generated/torch.logical_or.html) | [mindspore.mint.logical_or](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.logical_or.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.logical_xor](https://pytorch.org/docs/2.1/generated/torch.logical_xor.html) | [mindspore.mint.logical_xor](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.logical_xor.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.lt](https://pytorch.org/docs/2.1/generated/torch.lt.html) | [mindspore.mint.lt](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.lt.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.masked_select](https://pytorch.org/docs/2.1/generated/torch.masked_select.html) | [mindspore.mint.masked_select](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.masked_select.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.matmul](https://pytorch.org/docs/2.1/generated/torch.matmul.html#torch.matmul) | [mindspore.mint.matmul](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.matmul.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.max](https://pytorch.org/docs/2.1/generated/torch.max.html) | [mindspore.mint.max](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.max.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.maximum](https://pytorch.org/docs/2.1/generated/torch.maximum.html) | [mindspore.mint.maximum](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.maximum.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.mean](https://pytorch.org/docs/2.1/generated/torch.mean.html) | [mindspore.mint.mean](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.mean.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.median](https://pytorch.org/docs/2.1/generated/torch.median.html) | [mindspore.mint.median](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.median.html) | The functions are consistent, but the default value of dim is different. | | [torch.meshgrid](https://pytorch.org/docs/2.1/generated/torch.meshgrid.html)| [mindspore.mint.meshgrid](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.meshgrid.html)| The functions are consistent, but the default value of indexing is different. | | [torch.mul](https://pytorch.org/docs/2.1/generated/torch.mul.html#torch.mul) | [mindspore.mint.mul](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.mul.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.min](https://pytorch.org/docs/2.1/generated/torch.min.html#torch.min) | [mindspore.mint.min](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.min.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.minimum](https://pytorch.org/docs/2.1/generated/torch.minimum.html) | [mindspore.mint.minimum](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.minimum.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.mm](https://pytorch.org/docs/2.1/generated/torch.mm.html) | [mindspore.mint.mm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.mm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.multinomial](https://pytorch.org/docs/2.1/generated/torch.multinomial.html) | [mindspore.mint.multinomial](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.multinomial.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.mv](https://pytorch.org/docs/2.1/generated/torch.mv.html) | [mindspore.mint.mv](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.mv.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nansum](https://pytorch.org/docs/2.1/generated/torch.nansum.html) | [mindspore.mint.nansum](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nansum.html) | The functions are consistent, but the default value of end is different. | | [torch.nan_to_num](https://pytorch.org/docs/2.1/generated/torch.nan_to_num.html) | [mindspore.mint.nan_to_num](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nan_to_num.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.narrow](https://pytorch.org/docs/2.1/generated/torch.narrow.html) | [mindspore.mint.narrow](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.narrow.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.ne](https://pytorch.org/docs/2.1/generated/torch.ne.html)| [mindspore.mint.ne](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.ne.html)| [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.neg](https://pytorch.org/docs/2.1/generated/torch.neg.html)| [mindspore.mint.neg](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.neg.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.negative](https://pytorch.org/docs/2.1/generated/torch.negative.html) | [mindspore.mint.negative](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.negative.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nonzero](https://pytorch.org/docs/2.1/generated/torch.nonzero.html) | [mindspore.mint.nonzero](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nonzero.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.normal](https://pytorch.org/docs/2.1/generated/torch.normal.html) | [mindspore.mint.normal](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.normal.html) | The parameters of interface overloading are different. | | [torch.norm](https://pytorch.org/docs/2.1/generated/torch.norm.html) | [mindspore.mint.norm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.norm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.ones](https://pytorch.org/docs/2.1/generated/torch.ones.html) | [mindspore.mint.ones](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.ones.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.ones_like](https://pytorch.org/docs/2.1/torch.html#torch.ones_like) | [mindspore.mint.ones_like](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.ones_like.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.outer](https://pytorch.org/docs/2.1/generated/torch.outer.html) | [mindspore.mint.outer](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.outer.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.permute](https://pytorch.org/docs/2.1/generated/torch.permute.html) | [mindspore.mint.permute](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.permute.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.polar](https://pytorch.org/docs/2.1/generated/torch.polar.html) | [mindspore.mint.polar](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.polar.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.pow](https://pytorch.org/docs/2.1/generated/torch.pow.html) | [mindspore.mint.pow](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.pow.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.prod](https://pytorch.org/docs/2.1/generated/torch.prod.html#torch.prod) | [mindspore.mint.prod](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.prod.html) |[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.rand](https://pytorch.org/docs/2.1/generated/torch.rand.html) | [mindspore.mint.rand](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.rand.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.rand_like](https://pytorch.org/docs/2.1/generated/torch.rand_like.html) | [mindspore.mint.rand_like](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.rand_like.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.randint](https://pytorch.org/docs/2.1/generated/torch.randint.html) | [mindspore.mint.randint](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.randint.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.randint_like](https://pytorch.org/docs/2.1/generated/torch.randint_like.html) | [mindspore.mint.randint_like](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.randint_like.html) | The functions are consistent, but the default value of low is different. | | [torch.randn](https://pytorch.org/docs/2.1/generated/torch.randn.html) | [mindspore.mint.randn](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.randn.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.randn_like](https://pytorch.org/docs/2.1/generated/torch.randn_like.html) | [mindspore.mint.randn_like](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.randn_like.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.randperm](https://pytorch.org/docs/2.1/generated/torch.randperm.html) | [mindspore.mint.randperm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.randperm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.ravel](https://pytorch.org/docs/2.1/generated/torch.ravel.html) | [mindspore.mint.ravel](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.ravel.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.reciprocal](https://pytorch.org/docs/2.1/generated/torch.reciprocal.html) | [mindspore.mint.reciprocal](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.reciprocal.html) |[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.remainder](https://pytorch.org/docs/2.1/generated/torch.remainder.html) | [mindspore.mint.remainder](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.remainder.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.repeat_interleave](https://pytorch.org/docs/2.1/generated/torch.repeat_interleave.html) | [mindspore.mint.repeat_interleave](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.repeat_interleave.html) | Consistent functions, PyTorch involves overloading. | | [torch.reshape](https://pytorch.org/docs/2.1/generated/torch.reshape.html) | [mindspore.mint.reshape](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.reshape.html) |[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.roll](https://pytorch.org/docs/2.1/generated/torch.roll.html) | [mindspore.mint.roll](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.roll.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.round](https://pytorch.org/docs/2.1/generated/torch.round.html)| [mindspore.mint.round](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.round.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.rsqrt](https://pytorch.org/docs/2.1/generated/torch.rsqrt.html) | [mindspore.mint.rsqrt](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.rsqrt.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.scatter](https://pytorch.org/docs/2.1/generated/torch.scatter.html) | [mindspore.mint.scatter](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.scatter.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.scatter_add](https://pytorch.org/docs/2.1/generated/torch.scatter_add.html) | [mindspore.mint.scatter_add](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.scatter_add.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.searchsorted](https://pytorch.org/docs/2.1/generated/torch.searchsorted.html) | [mindspore.mint.searchsorted](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.searchsorted.html) | The functions are consistent, but the default value of side is different. | | [torch.select](https://pytorch.org/docs/2.1/generated/torch.select.html) | [mindspore.mint.select](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.select.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.sigmoid](https://pytorch.org/docs/2.1/generated/torch.sigmoid.html) | [mindspore.mint.sigmoid](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.sigmoid.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.sign](https://pytorch.org/docs/2.1/generated/torch.sign.html) | [mindspore.mint.sign](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.sign.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.sin](https://pytorch.org/docs/2.1/generated/torch.sin.html)| [mindspore.mint.sin](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.sin.html)| [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.sinc](https://pytorch.org/docs/2.1/generated/torch.sinc.html)| [mindspore.mint.sinc](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.sinc.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.sinh](https://pytorch.org/docs/2.1/generated/torch.sinh.html)| [mindspore.mint.sinh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.sinh.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.sort](https://pytorch.org/docs/2.1/generated/torch.sort.html) | [mindspore.mint.sort](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.sort.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.split](https://pytorch.org/docs/2.1/generated/torch.split.html) | [mindspore.mint.split](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.split.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.sqrt](https://pytorch.org/docs/2.1/generated/torch.sqrt.html) | [mindspore.mint.sqrt](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.sqrt.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.square](https://pytorch.org/docs/2.1/generated/torch.square.html)| [mindspore.mint.square](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.square.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.squeeze](https://pytorch.org/docs/2.1/generated/torch.squeeze.html) | [mindspore.mint.squeeze](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.squeeze.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.stack](https://pytorch.org/docs/2.1/generated/torch.stack.html) | [mindspore.mint.stack](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.stack.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.std](https://pytorch.org/docs/2.1/generated/torch.std.html) | [mindspore.mint.std](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.std.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.std_mean](https://pytorch.org/docs/2.1/generated/torch.std_mean.html) | [mindspore.mint.std_mean](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.std_mean.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.sub](https://pytorch.org/docs/2.1/generated/torch.sub.html#torch.sub) | [mindspore.mint.sub](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.sub.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.sum](https://pytorch.org/docs/2.1/generated/torch.sum.html) | [mindspore.mint.sum](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.sum.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.swapaxes](https://pytorch.org/docs/2.1/generated/torch.swapaxes.html) | [mindspore.mint.swapaxes](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.swapaxes.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.t](https://pytorch.org/docs/2.1/generated/torch.t.html) | [mindspore.mint.t](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.t.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.tan](https://pytorch.org/docs/2.1/generated/torch.tan.html)| [mindspore.mint.tan](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.tan.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.tanh](https://pytorch.org/docs/2.1/generated/torch.tanh.html) | [mindspore.mint.tanh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.tanh.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.tile](https://pytorch.org/docs/2.1/generated/torch.tile.html) | [mindspore.mint.tile](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.tile.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.topk](https://pytorch.org/docs/2.1/generated/torch.topk.html#torch.topk) | [mindspore.mint.topk](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.topk.html) | The functions are consistent, but the default value of dim is different. | | [torch.trace](https://pytorch.org/docs/2.1/generated/torch.trace.html) | [mindspore.mint.trace](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.trace.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.transpose](https://pytorch.org/docs/2.1/generated/torch.transpose.html) | [mindspore.mint.transpose](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.transpose.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.tril](https://pytorch.org/docs/2.1/generated/torch.tril.html) | [mindspore.mint.tril](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.tril.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.triu](https://pytorch.org/docs/2.1/generated/torch.triu.html) | [mindspore.mint.triu](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.triu.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.trunc](https://pytorch.org/docs/2.1/generated/torch.trunc.html)| [mindspore.mint.trunc](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.trunc.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.unbind](https://pytorch.org/docs/2.1/generated/torch.unbind.html) | [mindspore.mint.unbind](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.unbind.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.unique](https://pytorch.org/docs/2.1/generated/torch.unique.html#torch.unique) | [mindspore.mint.unique](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.unique.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.unique_consecutive](https://pytorch.org/docs/2.1/generated/torch.unique_consecutive.html) | [mindspore.mint.unique_consecutive](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.unique_consecutive.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.unsqueeze](https://pytorch.org/docs/2.1/generated/torch.unsqueeze.html) | [mindspore.mint.unsqueeze](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.unsqueeze.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.var](https://pytorch.org/docs/2.1/generated/torch.var.html) | [mindspore.mint.var](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.var.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.var_mean](https://pytorch.org/docs/2.1/generated/torch.var_mean.html) | [mindspore.mint.var_mean](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.var_mean.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.where](https://pytorch.org/docs/2.1/generated/torch.where.html) | [mindspore.mint.where](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.where.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.xlogy](https://pytorch.org/docs/2.1/generated/torch.xlogy.html) | [mindspore.mint.xlogy](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.xlogy.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.zeros](https://pytorch.org/docs/2.1/generated/torch.zeros.html) | [mindspore.mint.zeros](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.zeros.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.zeros_like](https://pytorch.org/docs/2.1/generated/torch.zeros_like.html#torch-zeros-like) | [mindspore.mint.zeros_like](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.zeros_like.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | ## torch.linalg | PyTorch 2.1 APIs | MindSpore APIs | 说明 | | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---- | | [torch.linalg.inv](https://pytorch.org/docs/2.1/generated/torch.linalg.inv.html) | [mindspore.mint.linalg.inv](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.linalg.inv.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.linalg.matrix_norm](https://pytorch.org/docs/2.1/generated/torch.linalg.matrix_norm.html) | [mindspore.mint.linalg.matrix_norm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.linalg.matrix_norm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.linalg.norm](https://pytorch.org/docs/2.1/generated/torch.linalg.norm.html) | [mindspore.mint.linalg.norm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.linalg.norm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.linalg.vector_norm](https://pytorch.org/docs/2.1/generated/torch.linalg.vector_norm.html) | [mindspore.mint.linalg.vector_norm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.linalg.vector_norm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | ## torch.distributed | PyTorch 2.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.distributed.P2POp](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.P2POp) | [mindspore.mint.distributed.P2POp](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.P2POp.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.distributed.all_gather](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.all_gather) | [mindspore.mint.distributed.all_gather](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.all_gather.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.all_gather_into_tensor](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.all_gather_into_tensor) | [mindspore.mint.distributed.all_gather_into_tensor](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.all_gather_into_tensor.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.all_gather_object](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.all_gather_object) | [mindspore.mint.distributed.all_gather_object](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.all_gather_object.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.all_reduce](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.all_reduce) | [mindspore.mint.distributed.all_reduce](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.all_reduce.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.all_to_all_single](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.all_to_all_single) | [mindspore.mint.distributed.all_to_all_single](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.all_to_all_single.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.all_to_all](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.all_to_all) | [mindspore.mint.distributed.all_to_all](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.all_to_all.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.barrier](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.barrier) | [mindspore.mint.distributed.barrier](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.barrier.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.batch_isend_irecv](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.batch_isend_irecv) | [mindspore.mint.distributed.batch_isend_irecv](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.batch_isend_irecv.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.distributed.broadcast](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.broadcast) | [mindspore.mint.distributed.broadcast](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.broadcast.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.broadcast_object_list](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.broadcast_object_list) | [mindspore.mint.distributed.broadcast_object_list](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.broadcast_object_list.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | []() | [mindspore.mint.distributed.destroy_process_group](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.destroy_process_group.html) | Unique to MindSpore| | [torch.distributed.gather](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.gather) | [mindspore.mint.distributed.gather](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.gather.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.gather_object](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.gather_object) | [mindspore.mint.distributed.gather_object](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.gather_object.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.distributed.get_backend](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.get_backend) | [mindspore.mint.distributed.get_backend](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.get_backend.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.distributed.get_global_rank](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.get_global_rank) | [mindspore.mint.distributed.get_global_rank](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.get_global_rank.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.distributed.get_group_rank](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.get_group_rank) | [mindspore.mint.distributed.get_group_rank](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.get_group_rank.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.distributed.get_process_group_ranks](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.get_process_group_ranks) | [mindspore.mint.distributed.get_process_group_ranks](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.get_process_group_ranks.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.distributed.get_rank](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.get_rank) | [mindspore.mint.distributed.get_rank](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.get_rank.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.get_world_size](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.get_world_size) | [mindspore.mint.distributed.get_world_size](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.get_world_size.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.init_process_group](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.init_process_group) | [mindspore.mint.distributed.init_process_group](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.init_process_group.html) | Consistent functions, inconsistent parameter names. | | [torch.distributed.irecv](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.irecv) | [mindspore.mint.distributed.irecv](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.irecv.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.distributed.isend](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.isend) | [mindspore.mint.distributed.isend](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.isend.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.distributed.new_group](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.new_group) | [mindspore.mint.distributed.new_group](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.new_group.html) | Consistent functions, MindSpore has an additional parameter group_desc = None. | | [torch.distributed.recv](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.recv) | [mindspore.mint.distributed.recv](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.recv.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.reduce](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.reduce) | [mindspore.mint.distributed.reduce](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.reduce.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.reduce_scatter](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.reduce_scatter) | [mindspore.mint.distributed.reduce_scatter](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.reduce_scatter.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.reduce_scatter_tensor](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.reduce_scatter_tensor) | [mindspore.mint.distributed.reduce_scatter_tensor](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.reduce_scatter_tensor.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.scatter](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.scatter) | [mindspore.mint.distributed.scatter](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.scatter.html) |The functions are consistent, but the default value of scatter_list is different. | | [torch.distributed.scatter_object_list](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.scatter_object_list) | [mindspore.mint.distributed.scatter_object_list](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.scatter_object_list.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.distributed.send](https://pytorch.org/docs/2.1/distributed.html#torch.distributed.send) | [mindspore.mint.distributed.send](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.distributed.send.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| ## torch.nn | PyTorch 2.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.nn.AdaptiveAvgPool1d](https://PyTorch.org/docs/2.1/generated/torch.nn.AdaptiveAvgPool1d.html) | [mindspore.mint.nn.AdaptiveAvgPool1d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.AdaptiveAvgPool1d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.AdaptiveAvgPool2d](https://PyTorch.org/docs/2.1/generated/torch.nn.AdaptiveAvgPool2d.html) | [mindspore.mint.nn.AdaptiveAvgPool2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.AdaptiveAvgPool2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.AdaptiveAvgPool3d](https://PyTorch.org/docs/2.1/generated/torch.nn.AdaptiveAvgPool3d.html) | [mindspore.mint.nn.AdaptiveAvgPool3d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.AdaptiveAvgPool3d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.AvgPool2d](https://PyTorch.org/docs/2.1/generated/torch.nn.AvgPool2d.html) | [mindspore.mint.nn.AvgPool2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.AvgPool2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.BCELoss](https://PyTorch.org/docs/2.1/generated/torch.nn.BCELoss.html) | [mindspore.mint.nn.BCELoss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.BCELoss.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.BCEWithLogitsLoss](https://pytorch.org/docs/2.1/generated/torch.nn.BCEWithLogitsLoss.html) | [mindspore.mint.nn.BCEWithLogitsLoss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.BCEWithLogitsLoss.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.BatchNorm1d](https://PyTorch.org/docs/2.1/generated/torch.nn.BatchNorm1d.html) | [mindspore.mint.nn.BatchNorm1d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.BatchNorm1d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.BatchNorm2d](https://PyTorch.org/docs/2.1/generated/torch.nn.BatchNorm2d.html) | [mindspore.mint.nn.BatchNorm2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.BatchNorm2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.BatchNorm3d](https://PyTorch.org/docs/2.1/generated/torch.nn.BatchNorm3d.html) | [mindspore.mint.nn.BatchNorm3d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.BatchNorm3d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.ConstantPad1d](https://pytorch.org/docs/2.1/generated/torch.nn.ConstantPad1d.html) | [mindspore.mint.nn.ConstantPad1d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ConstantPad1d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ConstantPad2d](https://pytorch.org/docs/2.1/generated/torch.nn.ConstantPad2d.html) | [mindspore.mint.nn.ConstantPad2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ConstantPad2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ConstantPad3d](https://pytorch.org/docs/2.1/generated/torch.nn.ConstantPad3d.html) | [mindspore.mint.nn.ConstantPad3d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ConstantPad3d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Conv2d](https://pytorch.org/docs/2.1/generated/torch.nn.Conv2d.html) | [mindspore.mint.nn.Conv2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Conv2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Conv3d](https://pytorch.org/docs/2.1/generated/torch.nn.Conv3d.html) | [mindspore.mint.nn.Conv3d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Conv3d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ConvTranspose2d](https://pytorch.org/docs/2.1/generated/torch.nn.ConvTranspose2d.html) | [mindspore.mint.nn.ConvTranspose2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ConvTranspose2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.CrossEntropyLoss](https://pytorch.org/docs/2.1/generated/torch.nn.CrossEntropyLoss.html) | [mindspore.mint.nn.CrossEntropyLoss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.CrossEntropyLoss.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Dropout](https://pytorch.org/docs/2.1/generated/torch.nn.Dropout.html) | [mindspore.mint.nn.Dropout](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Dropout.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Dropout2d](https://pytorch.org/docs/2.1/generated/torch.nn.Dropout2d.html) | [mindspore.mint.nn.Dropout2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Dropout2d.html) |Consistent functions, MindSpore has no parameter inplace. | | [torch.nn.ELU](https://pytorch.org/docs/2.1/generated/torch.nn.ELU.html) | [mindspore.mint.nn.ELU](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ELU.html) |Consistent functions, MindSpore has no parameter inplace. | | [torch.nn.Embedding](https://pytorch.org/docs/2.1/generated/torch.nn.Embedding.html) | [mindspore.mint.nn.Embedding](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Embedding.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Flatten](https://pytorch.org/docs/2.1/generated/torch.nn.Flatten.html) | [mindspore.mint.flatten](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.flatten.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Fold](https://pytorch.org/docs/2.1/generated/torch.nn.Fold.html) | [mindspore.mint.nn.Fold](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Fold.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.GELU](https://pytorch.org/docs/2.1/generated/torch.nn.GELU.html) | [mindspore.mint.nn.GELU](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.GELU.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.GroupNorm](https://pytorch.org/docs/2.1/generated/torch.nn.GroupNorm.html) | [mindspore.mint.nn.GroupNorm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.GroupNorm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Hardshrink](https://pytorch.org/docs/2.1/generated/torch.nn.Hardshrink.html#torch.nn.Hardshrink) | [mindspore.mint.nn.Hardshrink](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Hardshrink.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Hardsigmoid](https://pytorch.org/docs/2.1/generated/torch.nn.Hardsigmoid.html) | [mindspore.mint.nn.Hardsigmoid](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Hardsigmoid.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Hardswish](https://pytorch.org/docs/2.1/generated/torch.nn.Hardswish.html) | [mindspore.mint.nn.Hardswish](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Hardswish.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Identity](https://pytorch.org/docs/2.1/generated/torch.nn.Identity.html) | [mindspore.mint.nn.Identity](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Identity.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.L1Loss](https://pytorch.org/docs/2.1/generated/torch.nn.L1Loss.html#torch.nn.L1Loss) | [mindspore.mint.nn.L1Loss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.L1Loss.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.LayerNorm](https://pytorch.org/docs/2.1/generated/torch.nn.LayerNorm.html) | [mindspore.mint.nn.LayerNorm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.LayerNorm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Linear](https://pytorch.org/docs/2.1/generated/torch.nn.Linear.html) | [mindspore.mint.nn.Linear](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Linear.html) | Consistent function, MindSpore has two different parameters: weight_init = None and bias_init = None. | | [torch.nn.LogSigmoid](https://pytorch.org/docs/2.1/generated/torch.nn.LogSigmoid.html) | [mindspore.mint.nn.LogSigmoid](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.LogSigmoid.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.LogSoftMax](https://pytorch.org/docs/2.1/generated/torch.nn.LogSoftmax.html) | [mindspore.mint.nn.LogSoftmax](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.LogSoftmax.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.MSELoss](https://pytorch.org/docs/2.1/generated/torch.nn.MSELoss.html) | [mindspore.mint.nn.MSELoss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.MSELoss.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.MaxUnpool2d](https://pytorch.org/docs/2.1/generated/torch.nn.MaxUnpool2d.html) | [mindspore.mint.nn.MaxUnpool2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.MaxUnpool2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Mish](https://pytorch.org/docs/2.1/generated/torch.nn.Mish.html) | [mindspore.mint.nn.Mish](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Mish.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.NLLLoss](https://pytorch.org/docs/2.1/generated/torch.nn.NLLLoss.html) | [mindspore.mint.nn.NLLLoss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.NLLLoss.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.PReLU](https://pytorch.org/docs/2.1/generated/torch.nn.PReLU.html) | [mindspore.mint.nn.PReLU](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.PReLU.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ReLU](https://pytorch.org/docs/2.1/generated/torch.nn.ReLU.html) | [mindspore.mint.nn.ReLU](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ReLU.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.ReLU6](https://pytorch.org/docs/2.1/generated/torch.nn.ReLU6.html) | [mindspore.mint.nn.ReLU6](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ReLU6.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ReflectionPad1d](https://pytorch.org/docs/2.1/generated/torch.nn.ReflectionPad1d.html) | [mindspore.mint.nn.ReflectionPad1d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ReflectionPad1d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ReflectionPad2d](https://pytorch.org/docs/2.1/generated/torch.nn.ReflectionPad2d.html) | [mindspore.mint.nn.ReflectionPad2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ReflectionPad2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ReflectionPad3d](https://pytorch.org/docs/2.1/generated/torch.nn.ReflectionPad3d.html) | [mindspore.mint.nn.ReflectionPad3d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ReflectionPad3d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ReplicationPad1d](https://pytorch.org/docs/2.1/generated/torch.nn.ReplicationPad1d.html) | [mindspore.mint.nn.ReplicationPad1d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ReplicationPad1d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ReplicationPad2d](https://pytorch.org/docs/2.1/generated/torch.nn.ReplicationPad2d.html) | [mindspore.mint.nn.ReplicationPad2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ReplicationPad2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ReplicationPad3d](https://pytorch.org/docs/2.1/generated/torch.nn.ReplicationPad3d.html) | [mindspore.mint.nn.ReplicationPad3d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ReplicationPad3d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.SeLU](https://pytorch.org/docs/2.1/generated/torch.nn.SELU.html) | [mindspore.mint.nn.SELU](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.SELU.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.SiLU](https://pytorch.org/docs/2.1/generated/torch.nn.SiLU.html) | [mindspore.mint.nn.SiLU](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.SiLU.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.SmoothL1Loss](https://pytorch.org/docs/2.1/generated/torch.nn.SmoothL1Loss.html) | [mindspore.mint.nn.SmoothL1Loss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.SmoothL1Loss.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Softmax](https://pytorch.org/docs/2.1/generated/torch.nn.Softmax.html) | [mindspore.mint.nn.Softmax](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Softmax.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.Softshrink](https://pytorch.org/docs/2.1/generated/torch.nn.Softshrink.html) | [mindspore.mint.nn.Softshrink](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Softshrink.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.SyncBatchNorm](https://pytorch.org/docs/2.1/generated/torch.nn.SyncBatchNorm.html) | [mindspore.mint.nn.SyncBatchNorm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.SyncBatchNorm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Tanh](https://pytorch.org/docs/2.1/generated/torch.nn.Tanh.html) | [mindspore.mint.nn.Tanh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Tanh.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.Unfold](https://pytorch.org/docs/2.1/generated/torch.nn.Unfold.html) | [mindspore.mint.nn.Unfold](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Unfold.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.Upsample](https://pytorch.org/docs/2.1/generated/torch.nn.Upsample.html) | [mindspore.mint.nn.Upsample](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.Upsample.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ZeroPad1d](https://pytorch.org/docs/2.1/generated/torch.nn.ZeroPad1d.html) | [mindspore.mint.nn.ZeroPad1d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ZeroPad1d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ZeroPad2d](https://pytorch.org/docs/2.1/generated/torch.nn.ZeroPad2d.html) | [mindspore.mint.nn.ZeroPad2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ZeroPad2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.ZeroPad3d](https://pytorch.org/docs/2.1/generated/torch.nn.ZeroPad3d.html) | [mindspore.mint.nn.ZeroPad3d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.ZeroPad3d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | ## torch.nn.functional | PyTorch 2.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torch.nn.functional.adaptive_avg_pool1d](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.adaptive_avg_pool1d) | [mindspore.mint.nn.functional.adaptive_avg_pool1d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.adaptive_avg_pool1d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.adaptive_avg_pool2d](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.adaptive_avg_pool2d) | [mindspore.mint.nn.functional.adaptive_avg_pool2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.adaptive_avg_pool2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.avg_pool1d](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.avg_pool1d) | [mindspore.mint.nn.functional.avg_pool1d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.avg_pool1d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.avg_pool2d](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.avg_pool2d) | [mindspore.mint.nn.functional.avg_pool2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.avg_pool2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.batch_norm](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.batch_norm) | [mindspore.mint.nn.functional.batch_norm](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.batch_norm.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.functional.binary_cross_entropy](https://pytorch.org/docs/2.1/nn.functional.html#binary-cross-entropy) | [mindspore.mint.nn.functional.binary_cross_entropy](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.binary_cross_entropy.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.binary_cross_entropy_with_logits](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.binary_cross_entropy_with_logits) | [mindspore.mint.nn.functional.binary_cross_entropy_with_logits](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.binary_cross_entropy_with_logits.html) |[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.conv2d](https://pytorch.org/docs/2.1/generated/torch.nn.functional.conv2d.html) | [mindspore.mint.nn.functional.conv2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.conv2d.html)| [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.conv3d](https://pytorch.org/docs/2.1/generated/torch.nn.functional.conv3d.html) | [mindspore.mint.nn.functional.conv3d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.conv3d.html)| [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.conv_transpose2d](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.conv_transpose2d) | [mindspore.mint.nn.functional.conv_transpose2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.conv_transpose2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.dropout](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.dropout) | [mindspore.mint.nn.functional.dropout](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.dropout.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.dropout2d](https://pytorch.org/docs/2.1/generated/torch.nn.functional.dropout2d.html#torch.nn.functional.dropout2d) | [mindspore.mint.nn.functional.dropout2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.dropout2d.html) | Consistent functions, MindSpore does not contain the parameter inplace. | | [torch.nn.functional.elu](https://pytorch.org/docs/2.1/nn.functional.html#elu) | [mindspore.mint.nn.functional.elu](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.elu.html) | Consistent functions, MindSpore does not contain the parameter inplace. | | [torch.nn.functional.embedding](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.embedding) | [mindspore.mint.nn.functional.embedding](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.embedding.html) | Consistent functions, MindSpore does not contain the parameter sparse. | | [torch.nn.functional.fold](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.fold) | [mindspore.mint.nn.functional.fold](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.fold.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.functional.gelu](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.gelu) | [mindspore.mint.nn.functional.gelu](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.gelu.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.functional.grid_sample](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.grid_sample) | [mindspore.mint.nn.functional.grid_sample](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.grid_sample.html) | Consistent functions, but the default value of align_corners is different. | | [torch.nn.functional.hardshrink](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.hardshrink) | [mindspore.mint.nn.functional.hardshrink](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.hardshrink.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.hardsigmoid](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.hardsigmoid) | [mindspore.mint.nn.functional.hardsigmoid](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.hardsigmoid.html) |Consistent functions, MindSpore has no parameter inplace. | | [torch.nn.functional.hardswish](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.hardswish) | [mindspore.mint.nn.functional.hardswish](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.hardswish.html) |Consistent functions, MindSpore has no parameter inplace. | | [torch.nn.functional.interpolate](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.interpolate) | [mindspore.mint.nn.functional.interpolate](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.interpolate.html) | Consistent functions, MindSpore has no parameter antialias. | | [torch.nn.functional.l1_loss](https://pytorch.org/docs/2.1/nn.functional.html#l1-loss) | [mindspore.mint.nn.functional.l1_loss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.l1_loss.html) | Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.leaky_relu](https://pytorch.org/docs/2.1/nn.functional.html#leaky-relu) | [mindspore.mint.nn.functional.leaky_relu](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.leaky_relu.html) |Consistent functions, MindSpore has no parameter inplace. | | [torch.nn.functional.linear](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.linear) | [mindspore.mint.nn.functional.linear](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.linear.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.log_softmax](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.log_softmax) | [mindspore.mint.nn.functional.log_softmax](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.log_softmax.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.logsigmoid](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.logsigmoid) | [mindspore.mint.nn.functional.logsigmoid](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.logsigmoid.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.max_pool2d](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.max_pool2d) | [mindspore.mint.nn.functional.max_pool2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.max_pool2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.max_unpool2d](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.max_unpool2d) | [mindspore.mint.nn.functional.max_unpool2d](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.max_unpool2d.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.mish](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.mish) | [mindspore.mint.nn.functional.mish](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.mish.html) |Consistent functions, MindSpore has no parameter inplace. | | [torch.nn.functional.mse_loss](https://pytorch.org/docs/2.1/nn.functional.html#mse-loss) | [mindspore.mint.nn.functional.mse_loss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.mse_loss.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.nll_loss](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.nll_loss) | [mindspore.mint.nn.functional.nll_loss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.nll_loss.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.normalize](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.normalize) | [mindspore.mint.nn.functional.normalize](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.normalize.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.one_hot](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.one_hot) | [mindspore.mint.nn.functional.one_hot](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.one_hot.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.pad](https://pytorch.org/docs/2.1/nn.functional.html#pad) | [mindspore.mint.nn.functional.pad](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.pad.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.prelu](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.prelu) | [mindspore.mint.nn.functional.prelu](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.prelu.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.relu](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.relu) | [mindspore.mint.nn.functional.relu](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.relu.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.relu6](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.relu6) | [mindspore.mint.nn.functional.relu6](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.relu6.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.relu_](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.relu_) | [mindspore.mint.nn.functional.relu_](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.relu_.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.selu](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.selu) | [mindspore.mint.nn.functional.selu](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.selu.html) | Consistent functions, MindSpore does not contain parameter inplace. | | [torch.nn.functional.sigmoid](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.sigmoid) | [mindspore.mint.nn.functional.sigmoid](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.sigmoid.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.silu](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.silu) | [mindspore.mint.nn.functional.silu](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.silu.html) | Consistent functions, MindSpore does not contain parameter inplace. | | [torch.nn.functional.smooth_l1_loss](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.smooth_l1_loss) | [mindspore.mint.nn.functional.smooth_l1_loss](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.smooth_l1_loss.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.softmax](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.softmax) | [mindspore.mint.nn.functional.softmax](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.softmax.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.nn.functional.softplus](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.softplus) | [mindspore.mint.nn.functional.softplus](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.softplus.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.softshrink](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.softshrink) | [mindspore.mint.nn.functional.softshrink](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.softshrink.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.tanh](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.tanh) | [mindspore.mint.nn.functional.tanh](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.tanh.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.nn.functional.unfold](https://pytorch.org/docs/2.1/nn.functional.html#torch.nn.functional.unfold) | [mindspore.mint.nn.functional.unfold](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.nn.functional.unfold.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | ## torch.special | PyTorch 2.1 APIs | MindSpore APIs | 说明 | | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---- | | [torch.special.erfc](https://pytorch.org/docs/2.1/special.html#torch.special.erfc) | [mindspore.mint.special.erfc](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.special.erfc.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.special.exp2](https://pytorch.org/docs/2.1/special.html#torch.special.exp2) | [mindspore.mint.special.exp2](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.special.exp2.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.special.expm1](https://pytorch.org/docs/2.1/special.html#torch.special.expm1) | [mindspore.mint.special.expm1](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.special.expm1.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.special.log1p](https://pytorch.org/docs/2.1/special.html#torch.special.log1p) | [mindspore.mint.special.log1p](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.special.log1p.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.special.log_softmax](https://pytorch.org/docs/2.1/special.html#torch.special.log_softmax) | [mindspore.mint.special.log_softmax](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.special.log_softmax.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.special.round](https://pytorch.org/docs/2.1/special.html#torch.special.round) | [mindspore.mint.special.round](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.special.round.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.special.sinc](https://pytorch.org/docs/2.1/special.html#torch.special.sinc) | [mindspore.mint.special.sinc](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.special.sinc.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | ## torch.Tensor | PyTorch 2.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ |---------------------------------------------| | [torch.Tensor.abs](https://pytorch.org/docs/2.1/generated/torch.Tensor.abs.html) | [mindspore.Tensor.abs](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.abs.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.absolute](https://pytorch.org/docs/2.1/generated/torch.Tensor.absolute.html) | [mindspore.Tensor.absolute](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.absolute.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.add](https://pytorch.org/docs/2.1/generated/torch.Tensor.add.html)| [mindspore.Tensor.add](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.add.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.all](https://pytorch.org/docs/2.1/generated/torch.Tensor.all.html) | [mindspore.Tensor.all](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.all.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.any](https://pytorch.org/docs/2.1/generated/torch.Tensor.any.html) | [mindspore.Tensor.any](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.any.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.argmax](https://pytorch.org/docs/2.1/generated/torch.Tensor.argmax.html) | [mindspore.Tensor.argmax](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.argmax.html#mindspore.Tensor.argmax) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.arctan2](https://pytorch.org/docs/2.1/generated/torch.Tensor.arctan2.html) | [mindspore.Tensor.arctan2](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.arctan2.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.argmin](https://pytorch.org/docs/2.1/generated/torch.Tensor.argmin.html) | [mindspore.Tensor.argmin](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.argmin.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.atan2](https://pytorch.org/docs/2.1/generated/torch.Tensor.atan2.html) | [mindspore.Tensor.atan2](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.atan2.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.bool](https://pytorch.org/docs/2.1/generated/torch.Tensor.bool.html)| [mindspore.Tensor.bool](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.bool.html)| [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.ceil](https://pytorch.org/docs/2.1/generated/torch.Tensor.ceil.html) | [mindspore.Tensor.ceil](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.ceil.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.chunk](https://pytorch.org/docs/2.1/generated/torch.Tensor.chunk.html) | [mindspore.Tensor.chunk](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.chunk.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.clamp](https://pytorch.org/docs/2.1/generated/torch.Tensor.clamp.html) | [mindspore.Tensor.clamp](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.clamp.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.clamp_](https://pytorch.org/docs/2.1/generated/torch.Tensor.clamp_.html) | [mindspore.Tensor.clamp_](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.clamp_.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.clip](https://pytorch.org/docs/2.1/generated/torch.Tensor.clip.html) | [mindspore.Tensor.clip](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.clip.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.cos](https://pytorch.org/docs/2.1/generated/torch.Tensor.cos.html) | [mindspore.Tensor.cos](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.cos.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.cumsum](https://pytorch.org/docs/2.1/generated/torch.Tensor.cumsum.html) | [mindspore.Tensor.cumsum](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.cumsum.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.div](https://pytorch.org/docs/2.1/generated/torch.Tensor.div.html) | [mindspore.Tensor.div](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.div.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.divide](https://pytorch.org/docs/2.1/generated/torch.Tensor.divide.html) | [mindspore.Tensor.divide](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.divide.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.eq](https://pytorch.org/docs/2.1/generated/torch.Tensor.eq.html) | [mindspore.Tensor.eq](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.eq.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.erf](https://pytorch.org/docs/2.1/generated/torch.Tensor.erf.html) | [mindspore.Tensor.erf](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.erf.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.exp](https://pytorch.org/docs/2.1/generated/torch.Tensor.exp.html) | [mindspore.Tensor.exp](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.exp.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.expand_as](https://pytorch.org/docs/2.1/generated/torch.Tensor.expand_as.html) | [mindspore.Tensor.expand_as](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.expand_as.html#mindspore.Tensor.expand_as) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.flatten](https://pytorch.org/docs/2.1/generated/torch.Tensor.flatten.html) | [mindspore.Tensor.flatten](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.flatten.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.float](https://pytorch.org/docs/2.1/generated/torch.Tensor.float.html) | [mindspore.Tensor.float](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.float.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.floor](https://pytorch.org/docs/2.1/generated/torch.Tensor.floor.html) | [mindspore.Tensor.floor](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.floor.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.gather](https://pytorch.org/docs/2.1/generated/torch.Tensor.gather.html) | [mindspore.Tensor.gather](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.gather.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.greater](https://pytorch.org/docs/2.1/generated/torch.Tensor.greater.html) | [mindspore.Tensor.greater](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.greater.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.gt](https://pytorch.org/docs/2.1/generated/torch.Tensor.gt.html) | [mindspore.Tensor.gt](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.gt.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.half](https://pytorch.org/docs/2.1/generated/torch.Tensor.half.html) | [mindspore.Tensor.half](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.half.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.index_select](https://pytorch.org/docs/2.1/generated/torch.Tensor.index_select.html) | [mindspore.Tensor.index_select](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.index_select.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.int](https://pytorch.org/docs/2.1/generated/torch.Tensor.int.html) | [mindspore.Tensor.int](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.int.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.isfinite](https://pytorch.org/docs/2.1/generated/torch.Tensor.isfinite.html) | [mindspore.Tensor.isfinite](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.isfinite.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.isnan](https://pytorch.org/docs/2.1/generated/torch.Tensor.isnan.html) | [mindspore.Tensor.isnan](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.isnan.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.item](https://pytorch.org/docs/2.1/generated/torch.Tensor.item.html) | [mindspore.Tensor.item](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.item.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.le](https://pytorch.org/docs/2.1/generated/torch.Tensor.le.html) | [mindspore.Tensor.le](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.le.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.less](https://pytorch.org/docs/2.1/generated/torch.Tensor.less.html) | [mindspore.Tensor.less](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.less.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.less_equal](https://pytorch.org/docs/2.1/generated/torch.Tensor.less_equal.html) | [mindspore.Tensor.less_equal](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.less_equal.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.log](https://pytorch.org/docs/2.1/generated/torch.Tensor.log.html) | [mindspore.Tensor.log](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.log.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.logical_and](https://pytorch.org/docs/2.1/generated/torch.Tensor.logical_and.html) | [mindspore.Tensor.logical_and](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.logical_and.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.logical_not](https://pytorch.org/docs/2.1/generated/torch.Tensor.logical_not.html) | [mindspore.Tensor.logical_not](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.logical_not.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.logical_or](https://pytorch.org/docs/2.1/generated/torch.Tensor.logical_or.html) | [mindspore.Tensor.logical_or](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.logical_or.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.long](https://pytorch.org/docs/2.1/generated/torch.Tensor.long.html) | [mindspore.Tensor.long](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.long.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.lt](https://pytorch.org/docs/2.1/generated/torch.Tensor.lt.html) | [mindspore.Tensor.lt](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.lt.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.masked_fill](https://pytorch.org/docs/2.1/generated/torch.Tensor.masked_fill.html) | [mindspore.Tensor.masked_fill](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.masked_fill.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.masked_select](https://pytorch.org/docs/2.1/generated/torch.Tensor.masked_select.html) | [mindspore.Tensor.masked_select](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.masked_select.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.matmul](https://pytorch.org/docs/2.1/generated/torch.Tensor.matmul.html) | [mindspore.Tensor.matmul](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.matmul.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.max](https://pytorch.org/docs/2.1/generated/torch.Tensor.max.html) | [mindspore.Tensor.max](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.max.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.maximum](https://pytorch.org/docs/2.1/generated/torch.Tensor.maximum.html) | [mindspore.Tensor.maximum](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.maximum.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.mean](https://pytorch.org/docs/2.1/generated/torch.Tensor.mean.html) | [mindspore.Tensor.mean](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.mean.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.min](https://pytorch.org/docs/2.1/generated/torch.Tensor.min.html) | [mindspore.Tensor.min](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.min.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.minimum](https://pytorch.org/docs/2.1/generated/torch.Tensor.minimum.html) | [mindspore.Tensor.minimum](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.minimum.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.mul](https://pytorch.org/docs/2.1/generated/torch.Tensor.mul.html) | [mindspore.Tensor.mul](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.mul.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.nan_to_num](https://pytorch.org/docs/2.1/generated/torch.Tensor.nan_to_num.html) | [mindspore.Tensor.nan_to_num](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.nan_to_num.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.ne](https://pytorch.org/docs/2.1/generated/torch.Tensor.ne.html) | [mindspore.Tensor.ne](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.ne.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.neg](https://pytorch.org/docs/2.1/generated/torch.Tensor.neg.html) | [mindspore.Tensor.neg](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.neg.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.negative](https://pytorch.org/docs/2.1/generated/torch.Tensor.negative.html) | [mindspore.Tensor.negative](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.negative.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.not_equal](https://pytorch.org/docs/2.1/generated/torch.Tensor.not_equal.html) | [mindspore.Tensor.not_equal](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.not_equal.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.pow](https://pytorch.org/docs/2.1/generated/torch.Tensor.pow.html) | [mindspore.Tensor.pow](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.pow.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.prod](https://pytorch.org/docs/2.1/generated/torch.Tensor.prod.html) | [mindspore.Tensor.prod](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.prod.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.reciprocal](https://pytorch.org/docs/2.1/generated/torch.Tensor.reciprocal.html) | [mindspore.Tensor.reciprocal](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.reciprocal.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.remainder](https://pytorch.org/docs/2.1/generated/torch.Tensor.remainder.html) | [mindspore.Tensor.remainder](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.remainder.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.repeat_interleave](https://pytorch.org/docs/2.1/generated/torch.Tensor.repeat_interleave.html) | [mindspore.Tensor.repeat_interleave](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.repeat_interleave.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.reshape](https://pytorch.org/docs/2.1/generated/torch.Tensor.reshape.html) | [mindspore.Tensor.reshape](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.reshape.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.round](https://pytorch.org/docs/2.1/generated/torch.Tensor.round.html)| [mindspore.Tensor.round](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.round.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.rsqrt](https://pytorch.org/docs/2.1/generated/torch.Tensor.rsqrt.html) | [mindspore.Tensor.rsqrt](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.rsqrt.html) |[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.scatter](https://pytorch.org/docs/2.1/generated/torch.Tensor.scatter.html) | [mindspore.Tensor.scatter](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.scatter.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.scatter_add](https://pytorch.org/docs/2.1/generated/torch.Tensor.scatter_add.html) | [mindspore.Tensor.scatter_add](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.scatter_add.html) |[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.sigmoid](https://pytorch.org/docs/2.1/generated/torch.Tensor.sigmoid.html) | [mindspore.Tensor.sigmoid](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.sigmoid.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.sin](https://pytorch.org/docs/2.1/generated/torch.Tensor.sin.html)| [mindspore.Tensor.sin](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.sin.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.sort](https://pytorch.org/docs/2.1/generated/torch.Tensor.sort.html) | [mindspore.Tensor.sort](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.sort.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.split](https://pytorch.org/docs/2.1/generated/torch.Tensor.split.html) | [mindspore.Tensor.split](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.split.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.sqrt](https://pytorch.org/docs/2.1/generated/torch.Tensor.sqrt.html) | [mindspore.Tensor.sqrt](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.sqrt.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.square](https://pytorch.org/docs/2.1/generated/torch.Tensor.square.html)| [mindspore.Tensor.square](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.square.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.sub](https://pytorch.org/docs/2.1/generated/torch.Tensor.sub.html) | [mindspore.Tensor.sub](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.sub.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.sum](https://pytorch.org/docs/2.1/generated/torch.Tensor.sum.html) | [mindspore.Tensor.sum](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.sum.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.t](https://pytorch.org/docs/2.1/generated/torch.Tensor.t.html) | [mindspore.Tensor.t](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.t.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.tanh](https://pytorch.org/docs/2.1/generated/torch.Tensor.tanh.html) | [mindspore.Tensor.tanh](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.tanh.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.tile](https://pytorch.org/docs/2.1/generated/torch.Tensor.tile.html) | [mindspore.Tensor.tile](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.tile.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.topk](https://pytorch.org/docs/2.1/generated/torch.Tensor.topk.html)| [mindspore.Tensor.topk](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.topk.html)|[Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.tril](https://pytorch.org/docs/2.1/generated/torch.Tensor.tril.html) | [mindspore.Tensor.tril](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.tril.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.trunc](https://pytorch.org/docs/2.1/generated/torch.Tensor.trunc.html) | [mindspore.Tensor.trunc](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.trunc.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions)| | [torch.Tensor.view_as](https://pytorch.org/docs/2.1/generated/torch.Tensor.view_as.html) | [mindspore.Tensor.view_as](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.view_as.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | | [torch.Tensor.where](https://pytorch.org/docs/2.1/generated/torch.Tensor.where.html) | [mindspore.Tensor.where](https://www.mindspore.cn/docs/en/master/api_python/mindspore/Tensor/mindspore.Tensor.where.html) | [Consistent](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_api_mapping.html#api-mapping-consistency-criteria-and-exceptions) | ## torch.optim | PyTorch 2.1 APIs | MindSpore APIs | Descriptions | |------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------| | [torch.optim.Adam](https://pytorch.org/docs/2.1/optim.html#torch.optim.Adam) | [mindspore.mint.optim.Adam](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.optim.Adam.html) | The functions are consistent, but PyTorch has some optimization parameters | | [torch.optim.AdamW](https://pytorch.org/docs/2.1/optim.html#torch.optim.AdamW) | [mindspore.mint.optim.AdamW](https://www.mindspore.cn/docs/en/master/api_python/mint/mindspore.mint.optim.AdamW.html) | The functions are consistent, but PyTorch has some optimization parameters | ## 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) | [mindspore.dataset.GeneratorDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.GeneratorDataset.html#mindspore.dataset.GeneratorDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/DataLoader.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/master/api_python/dataset/mindspore.dataset.DistributedSampler.html#mindspore.dataset.DistributedSampler) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/DistributedSampler.html) | | [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/master/api_python/dataset/mindspore.dataset.RandomSampler.html#mindspore.dataset.RandomSampler) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/RandomSampler.html) | | [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/master/api_python/dataset/mindspore.dataset.SequentialSampler.html#mindspore.dataset.SequentialSampler) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/SequentialSampler.html) | | [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/master/api_python/dataset/mindspore.dataset.SubsetRandomSampler.html#mindspore.dataset.SubsetRandomSampler) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/SubsetRandomSampler.html) | | [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/master/api_python/dataset/mindspore.dataset.WeightedRandomSampler.html#mindspore.dataset.WeightedRandomSampler) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/WeightedRandomSampler.html) | | | [torch.utils.checkpoint.checkpoint](https://pytorch.org/docs/1.8.1/checkpoint.html#torch.utils.checkpoint.checkpoint) | [mindspore.nn.Cell.recompute](https://www.mindspore.cn/docs/en/master/api_python/nn/mindspore.nn.Cell.html#mindspore.nn.Cell.recompute) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/checkpoint.html) | ## torchaudio > The current API mapping table corresponds to PyTorch version 1.8.1, and Python version is no higher than Python 3.9. | TorchAudio 0.8.1 APIs | MindSpore APIs | Descriptions | | ----------------------- | ------------------------- | ------------------ | | [torchaudio.datasets.CMUARCTIC](https://pytorch.org/audio/0.8.0/datasets.html#cmuarctic) | [mindspore.dataset.CMUArcticDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.CMUArcticDataset.html#mindspore.dataset.CMUArcticDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/CMUARCTIC.html) | | [torchaudio.datasets.GTZAN](https://pytorch.org/audio/0.8.0/datasets.html#gtzan) | [mindspore.dataset.GTZANDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.GTZANDataset.html#mindspore.dataset.GTZANDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/GTZAN.html) | | [torchaudio.datasets.LIBRITTS](https://pytorch.org/audio/0.8.0/datasets.html#libritts) | [mindspore.dataset.LibriTTSDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.LibriTTSDataset.html#mindspore.dataset.LibriTTSDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/LIBRITTS.html) | | [torchaudio.datasets.LJSPEECH](https://pytorch.org/audio/0.8.0/datasets.html#ljspeech) | [mindspore.dataset.LJSpeechDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.LJSpeechDataset.html#mindspore.dataset.LJSpeechDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/LJSPEECH.html) | | [torchaudio.datasets.SPEECHCOMMANDS](https://pytorch.org/audio/0.8.0/datasets.html#speechcommands) | [mindspore.dataset.SpeechCommandsDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.SpeechCommandsDataset.html#mindspore.dataset.SpeechCommandsDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/SPEECHCOMMANDS.html) | | [torchaudio.datasets.TEDLIUM](https://pytorch.org/audio/0.8.0/datasets.html#tedlium) | [mindspore.dataset.TedliumDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.TedliumDataset.html#mindspore.dataset.TedliumDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/TEDLIUM.html) | | [torchaudio.datasets.YESNO](https://pytorch.org/audio/0.8.0/datasets.html#yesno) | [mindspore.dataset.YesNoDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.YesNoDataset.html#mindspore.dataset.YesNoDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/YESNO.html) | | [torchaudio.transforms.AmplitudeToDB](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.AmplitudeToDB.html) | [mindspore.dataset.audio.AmplitudeToDB](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.AmplitudeToDB.html#mindspore.dataset.audio.AmplitudeToDB) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/AmplitudeToDB.html) | | [torchaudio.transforms.ComplexNorm](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.ComplexNorm.html) | [mindspore.dataset.audio.ComplexNorm](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.ComplexNorm.html#mindspore.dataset.audio.ComplexNorm) | Consistent | | [torchaudio.transforms.ComputeDeltas](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.ComputeDeltas.html) | [mindspore.dataset.audio.ComputeDeltas](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.ComputeDeltas.html#mindspore.dataset.audio.ComputeDeltas) | The functions are consistent, but the parameter names are inconsistent. | | [torchaudio.transforms.Fade](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.Fade.html) | [mindspore.dataset.audio.Fade](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.Fade.html#mindspore.dataset.audio.Fade) | Consistent | | [torchaudio.transforms.FrequencyMasking](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.FrequencyMasking.html) | [mindspore.dataset.audio.FrequencyMasking](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.FrequencyMasking.html#mindspore.dataset.audio.FrequencyMasking) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/FrequencyMasking.html) | | [torchaudio.transforms.GriffinLim](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.GriffinLim.html) | [mindspore.dataset.audio.GriffinLim](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.GriffinLim.html#mindspore.dataset.audio.GriffinLim) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/GriffinLim.html) | | [torchaudio.transforms.InverseMelScale](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.InverseMelScale.html) | [mindspore.dataset.audio.InverseMelScale](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.InverseMelScale.html#mindspore.dataset.audio.InverseMelScale) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/InverseMelScale.html) | | [torchaudio.transforms.MelScale](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.MelScale.html) | [mindspore.dataset.audio.MelScale](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.MelScale.html#mindspore.dataset.audio.MelScale) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/MelScale.html) | | [torchaudio.transforms.MelSpectrogram](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.MelSpectrogram.html) | [mindspore.dataset.audio.MelSpectrogram](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.MelSpectrogram.html#mindspore.dataset.audio.MelSpectrogram) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/MelSpectrogram.html) | | [torchaudio.transforms.MFCC](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.MFCC.html) | [mindspore.dataset.audio.MFCC](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.MFCC.html#mindspore.dataset.audio.MFCC) | Consistent | | [torchaudio.transforms.MuLawEncoding](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.MuLawEncoding.html) | [mindspore.dataset.audio.MuLawEncoding](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.MuLawEncoding.html#mindspore.dataset.audio.MuLawEncoding) | Consistent | | [torchaudio.transforms.MuLawDecoding](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.MuLawDecoding.html) | [mindspore.dataset.audio.MuLawDecoding](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.MuLawDecoding.html#mindspore.dataset.audio.MuLawDecoding) | Consistent | | [torchaudio.transforms.Resample](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.Resample.html) | [mindspore.dataset.audio.Resample](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.Resample.html#mindspore.dataset.audio.Resample) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/Resample.html) | | [torchaudio.transforms.SlidingWindowCmn](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.SlidingWindowCmn.html) | [mindspore.dataset.audio.SlidingWindowCmn](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.SlidingWindowCmn.html#mindspore.dataset.audio.SlidingWindowCmn) | Consistent | | [torchaudio.transforms.SpectralCentroid](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.SpectralCentroid.html) | [mindspore.dataset.audio.SpectralCentroid](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.SpectralCentroid.html#mindspore.dataset.audio.SpectralCentroid) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/SpectralCentroid.html) | | [torchaudio.transforms.Spectrogram](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.Spectrogram.html) | [mindspore.dataset.audio.Spectrogram](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.Spectrogram.html#mindspore.dataset.audio.Spectrogram) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/Spectrogram.html) | | [torchaudio.transforms.TimeMasking](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.TimeMasking.html) | [mindspore.dataset.audio.TimeMasking](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.TimeMasking.html#mindspore.dataset.audio.TimeMasking) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/TimeMasking.html) | | [torchaudio.transforms.TimeStretch](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.TimeStretch.html) | [mindspore.dataset.audio.TimeStretch](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.TimeStretch.html#mindspore.dataset.audio.TimeStretch) | Consistent | | [torchaudio.transforms.Vad](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.Vad.html) | [mindspore.dataset.audio.Vad](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.Vad.html#mindspore.dataset.audio.Vad) | Consistent | | [torchaudio.transforms.Vol](https://pytorch.org/audio/0.8.0/transforms.html#torchaudio.transforms.Vol.html) | [mindspore.dataset.audio.Vol](https://mindspore.cn/docs/en/master/api_python/dataset_audio/mindspore.dataset.audio.Vol.html#mindspore.dataset.audio.Vol) | Consistent | ## torchtext > The current API mapping table corresponds to PyTorch version 1.8.1, and Python version is no higher than Python 3.9. | TorchText 0.9.1 APIs | MindSpore APIs | Descriptions | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [torchtext.data.functional.custom_replace](https://pytorch.org/text/0.9.0/data_functional.html#custom-replace) | [mindspore.dataset.text.RegexReplace](https://mindspore.cn/docs/en/master/api_python/dataset_text/mindspore.dataset.text.RegexReplace.html#mindspore.dataset.text.RegexReplace) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/RegexReplace.html) | | [torchtext.data.functional.load_sp_model](https://pytorch.org/text/0.9.0/data_functional.html#load-sp-model) | [mindspore.dataset.text.SentencePieceTokenizer](https://www.mindspore.cn/docs/en/master/api_python/dataset_text/mindspore.dataset.text.SentencePieceTokenizer.html#mindspore.dataset.text.SentencePieceTokenizer) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/load_sp_model.html) | | [torchtext.data.functional.numericalize_tokens_from_iterator](https://pytorch.org/text/0.9.0/data_functional.html#numericalize-tokens-from-iterator) | [mindspore.dataset.text.Lookup](https://mindspore.cn/docs/en/master/api_python/dataset_text/mindspore.dataset.text.Lookup.html#mindspore.dataset.text.Lookup) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/Lookup.html) | | [torchtext.data.functional.sentencepiece_numericalizer](https://pytorch.org/text/0.9.0/data_functional.html#sentencepiece-numericalizer) | [mindspore.dataset.text.SentencePieceTokenizer](https://mindspore.cn/docs/en/master/api_python/dataset_text/mindspore.dataset.text.SentencePieceTokenizer.html#mindspore.dataset.text.SentencePieceTokenizer) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/SentencePieceTokenizer_Out_INT.html) | | [torchtext.data.functional.sentencepiece_tokenizer](https://pytorch.org/text/0.9.0/data_functional.html#sentencepiece-tokenizer) | [mindspore.dataset.text.SentencePieceTokenizer](https://mindspore.cn/docs/en/master/api_python/dataset_text/mindspore.dataset.text.SentencePieceTokenizer.html#mindspore.dataset.text.SentencePieceTokenizer) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/SentencePieceTokenizer_Out_STRING.html) | | [torchtext.data.functional.simple_space_split](https://pytorch.org/text/0.9.0/data_functional.html#simple-space-split) | [mindspore.dataset.text.WhitespaceTokenizer](https://mindspore.cn/docs/en/master/api_python/dataset_text/mindspore.dataset.text.WhitespaceTokenizer.html#mindspore.dataset.text.WhitespaceTokenizer) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/WhitespaceTokenizer.html) | | [torchtext.data.utils.ngrams_iterator](https://pytorch.org/text/0.9.0/data_utils.html#ngrams-iterator) | [mindspore.dataset.text.Ngram](https://mindspore.cn/docs/en/master/api_python/dataset_text/mindspore.dataset.text.Ngram.html#mindspore.dataset.text.Ngram) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/Ngram.html) | | [torchtext.datasets.AG_NEWS](https://pytorch.org/text/0.9.0/datasets.html#ag-news) | [mindspore.dataset.AGNewsDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.AGNewsDataset.html#mindspore.dataset.AGNewsDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/AGNEWS.html) | | [torchtext.datasets.AmazonReviewFull](https://pytorch.org/text/0.9.0/datasets.html#amazonreviewfull) | [mindspore.dataset.AmazonReviewDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.AmazonReviewDataset.html#mindspore.dataset.AmazonReviewDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/AmazonReviewFull.html) | | [torchtext.datasets.AmazonReviewPolarity](https://pytorch.org/text/0.9.0/datasets.html#amazonreviewpolarity) | [mindspore.dataset.AmazonReviewDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.AmazonReviewDataset.html#mindspore.dataset.AmazonReviewDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/AmazonReviewPolarity.html) | | [torchtext.datasets.CoNLL2000Chunking](https://pytorch.org/text/0.9.0/datasets.html#conll2000chunking) | [mindspore.dataset.CoNLL2000Dataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.CoNLL2000Dataset.html#mindspore.dataset.CoNLL2000Dataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/CoNLL2000Chunking.html) | | [torchtext.datasets.DBpedia](https://pytorch.org/text/0.9.0/datasets.html#dbpedia) | [mindspore.dataset.DBpediaDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.DBpediaDataset.html#mindspore.dataset.DBpediaDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/DBpedia.html) | | [torchtext.datasets.IMDB](https://pytorch.org/text/0.9.0/datasets.html#imdb) | [mindspore.dataset.IMDBDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.IMDBDataset.html#mindspore.dataset.IMDBDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/IMDB.html) | | [torchtext.datasets.IWSLT2016](https://pytorch.org/text/0.9.0/datasets.html#iwslt2016) | [mindspore.dataset.IWSLT2016Dataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.IWSLT2016Dataset.html#mindspore.dataset.IWSLT2016Dataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/IWSLT2016.html) | | [torchtext.datasets.IWSLT2017](https://pytorch.org/text/0.9.0/datasets.html#iwslt2017) | [mindspore.dataset.IWSLT2017Dataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.IWSLT2017Dataset.html#mindspore.dataset.IWSLT2017Dataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/IWSLT2017.html) | | [torchtext.datasets.PennTreebank](https://pytorch.org/text/0.9.0/datasets.html#penntreebank) | [mindspore.dataset.PennTreebankDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.PennTreebankDataset.html#mindspore.dataset.PennTreebankDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/PennTreebank.html) | | [torchtext.datasets.SogouNews](https://pytorch.org/text/0.9.0/datasets.html#sogounews) | [mindspore.dataset.SogouNewsDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.SogouNewsDataset.html#mindspore.dataset.SogouNewsDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/SogouNews.html) | | [torchtext.datasets.SQuAD1](https://pytorch.org/text/0.9.0/datasets.html#torchtext.datasets.SQuAD1) | [mindspore.dataset.SQuADDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.SQuADDataset.html#mindspore.dataset.SQuADDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/SQuAD1.html) | | [torchtext.datasets.SQuAD2](https://pytorch.org/text/0.9.0/datasets.html#torchtext.datasets.SQuAD2) | [mindspore.dataset.SQuADDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.SQuADDataset.html#mindspore.dataset.SQuADDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/SQuAD2.html) | | [torchtext.datasets.UDPOS](https://pytorch.org/text/0.9.0/datasets.html#udpos) | [mindspore.dataset.UDPOSDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.UDPOSDataset.html#mindspore.dataset.UDPOSDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/UDPOS.html) | | [torchtext.datasets.WikiText103](https://pytorch.org/text/0.9.0/datasets.html#wikitext103) | [mindspore.dataset.WikiTextDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.WikiTextDataset.html#mindspore.dataset.WikiTextDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/WikiText103.html) | | [torchtext.datasets.WikiText2](https://pytorch.org/text/0.9.0/datasets.html#wikitext-2) | [mindspore.dataset.WikiTextDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.WikiTextDataset.html#mindspore.dataset.WikiTextDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/WikiText2.html) | | [torchtext.datasets.YahooAnswers](https://pytorch.org/text/0.9.0/datasets.html#yahooanswers) | [mindspore.dataset.YahooAnswersDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.YahooAnswersDataset.html#mindspore.dataset.YahooAnswersDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/YahooAnswers.html) | | [torchtext.datasets.YelpReviewFull](https://pytorch.org/text/0.9.0/datasets.html#yelpreviewfull) | [mindspore.dataset.YelpReviewDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.YelpReviewDataset.html#mindspore.dataset.YelpReviewDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/YelpReviewFull.html) | | [torchtext.datasets.YelpReviewPolarity](https://pytorch.org/text/0.9.0/datasets.html#yelpreviewpolarity) | [mindspore.dataset.YelpReviewDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.YelpReviewDataset.html#mindspore.dataset.YelpReviewDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/YelpReviewPolarity.html) | ## torchvision > The current API mapping table corresponds to PyTorch version 1.8.1, and Python version is no higher than Python 3.9. | TorchVision 0.9.1 APIs | MindSpore APIs | Descriptions | | ---------------------------------------- | --------------------------------- | --------------------------------------- | | [torchvision.datasets.CelebA](https://pytorch.org/vision/0.9/datasets.html#torchvision.datasets.CelebA) | [mindspore.dataset.CelebADataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.CelebADataset.html#mindspore.dataset.CelebADataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/CelebA.html) | | [torchvision.datasets.Cityscapes](https://pytorch.org/vision/0.9/datasets.html#cityscapes) | [mindspore.dataset.CityscapesDataset](https://www.mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.CityscapesDataset.html) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/Cityscapes.html) | | [torchvision.datasets.CIFAR10](https://pytorch.org/vision/0.9/datasets.html#torchvision.datasets.CIFAR10) | [mindspore.dataset.Cifar10Dataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.Cifar10Dataset.html#mindspore.dataset.Cifar10Dataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/CIFAR10.html) | | [torchvision.datasets.CIFAR100](https://pytorch.org/vision/0.9/datasets.html#torchvision.datasets.CIFAR100) | [mindspore.dataset.Cifar100Dataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.Cifar100Dataset.html#mindspore.dataset.Cifar100Dataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/CIFAR100.html) | | [torchvision.datasets.CocoDetection](https://pytorch.org/vision/0.9/datasets.html#torchvision.datasets.CocoDetection) | [mindspore.dataset.CocoDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.CocoDataset.html#mindspore.dataset.CocoDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/CocoDataset.html) | | [torchvision.datasets.ImageFolder](https://pytorch.org/vision/0.9/datasets.html#torchvision.datasets.ImageFolder) | [mindspore.dataset.ImageFolderDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.ImageFolderDataset.html#mindspore.dataset.ImageFolderDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/ImageFolder.html) | | [torchvision.datasets.MNIST](https://pytorch.org/vision/0.9/datasets.html#torchvision.datasets.MNIST) | [mindspore.dataset.MnistDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.MnistDataset.html#mindspore.dataset.MnistDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/MNIST.html) | | [torchvision.datasets.VOCDetection](https://pytorch.org/vision/0.9/datasets.html#torchvision.datasets.VOCDetection) | [mindspore.dataset.VOCDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.VOCDataset.html#mindspore.dataset.VOCDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/VOCDetection.html) | | [torchvision.datasets.VOCSegmentation](https://pytorch.org/vision/0.9/datasets.html#torchvision.datasets.VOCSegmentation) | [mindspore.dataset.VOCDataset](https://mindspore.cn/docs/en/master/api_python/dataset/mindspore.dataset.VOCDataset.html#mindspore.dataset.VOCDataset) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/VOCSegmentation.html) | | [torchvision.ops.nms](https://pytorch.org/vision/0.9/ops.html#torchvision.ops.nms.html#torchvision.ops.nms) | [mindspore.ops.NMSWithMask](https://mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.NMSWithMask.html#mindspore.ops.NMSWithMask) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/nms.html) | | [torchvision.ops.roi_align](https://pytorch.org/vision/0.9/ops.html#torchvision.ops.roi_align.html#torchvision.ops.roi_align) | [mindspore.ops.ROIAlign](https://mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.ROIAlign.html#mindspore.ops.ROIAlign) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/roi_align.html) | | [torchvision.transforms.CenterCrop](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.CenterCrop) | [mindspore.dataset.vision.CenterCrop](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.CenterCrop.html#mindspore.dataset.vision.CenterCrop) | Consistent | | [torchvision.transforms.ColorJitter](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.ColorJitter) | [mindspore.dataset.vision.RandomColorAdjust](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.RandomColorAdjust.html#mindspore.dataset.vision.RandomColorAdjust) | Consistent | | [torchvision.transforms.Compose](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.Compose) | [mindspore.dataset.transforms.Compose](https://mindspore.cn/docs/en/master/api_python/dataset_transforms/mindspore.dataset.transforms.Compose.html#mindspore.dataset.transforms.Compose) | Consistent | | [torchvision.transforms.ConvertImageDtype](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.ConvertImageDtype) | [mindspore.dataset.transforms.TypeCast](https://mindspore.cn/docs/en/master/api_python/dataset_transforms/mindspore.dataset.transforms.TypeCast.html#mindspore.dataset.transforms.TypeCast) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/TypeCast.html) | | [torchvision.transforms.FiveCrop](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.FiveCrop) | [mindspore.dataset.vision.FiveCrop](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.FiveCrop.html#mindspore.dataset.vision.FiveCrop) | Consistent | | [torchvision.transforms.GaussianBlur](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.GaussianBlur) | [mindspore.dataset.vision.GaussianBlur](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.GaussianBlur.html#mindspore.dataset.vision.GaussianBlur) | Consistent | | [torchvision.transforms.Grayscale](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.Grayscale) | [mindspore.dataset.vision.Grayscale](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.Grayscale.html#mindspore.dataset.vision.Grayscale) | Consistent | | [torchvision.transforms.LinearTransformation](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.LinearTransformation) | [mindspore.dataset.vision.LinearTransformation](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.LinearTransformation.html#mindspore.dataset.vision.LinearTransformation) | Consistent | | [torchvision.transforms.Normalize](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.Normalize) | [mindspore.dataset.vision.Normalize](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.Normalize.html#mindspore.dataset.vision.Normalize) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/Normalize.html) | | [torchvision.transforms.Pad](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.Pad) | [mindspore.dataset.vision.Pad](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.Pad.html#mindspore.dataset.vision.Pad) | The functions are consistent, but the parameter names are inconsistent. | | [torchvision.transforms.RandomAffine](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomAffine) | [mindspore.dataset.vision.RandomAffine](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.RandomAffine.html#mindspore.dataset.vision.RandomAffine) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/RandomAffine.html) | | [torchvision.transforms.RandomApply](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomApply) | [mindspore.dataset.transforms.RandomApply](https://mindspore.cn/docs/en/master/api_python/dataset_transforms/mindspore.dataset.transforms.RandomApply.html#mindspore.dataset.transforms.RandomApply) | The functions are consistent, but the parameter names are inconsistent. | | [torchvision.transforms.RandomChoice](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomChoice) | [mindspore.dataset.transforms.RandomChoice](https://mindspore.cn/docs/en/master/api_python/dataset_transforms/mindspore.dataset.transforms.RandomChoice.html#mindspore.dataset.transforms.RandomChoice) | Consistent | | [torchvision.transforms.RandomCrop](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomCrop) | [mindspore.dataset.vision.RandomCrop](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.RandomCrop.html#mindspore.dataset.vision.RandomCrop) | The functions are consistent, but the parameter names are inconsistent. | | [torchvision.transforms.RandomGrayscale](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomGrayscale) | [mindspore.dataset.vision.RandomGrayscale](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.RandomGrayscale.html#mindspore.dataset.vision.RandomGrayscale) | The functions are consistent, but the parameter names are inconsistent. | | [torchvision.transforms.RandomHorizontalFlip](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomHorizontalFlip) | [mindspore.dataset.vision.RandomHorizontalFlip](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.RandomHorizontalFlip.html#mindspore.dataset.vision.RandomHorizontalFlip) | The functions are consistent, but the parameter names are inconsistent. | | [torchvision.transforms.RandomOrder](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomOrder) | [mindspore.dataset.transforms.RandomOrder](https://mindspore.cn/docs/en/master/api_python/dataset_transforms/mindspore.dataset.transforms.RandomOrder.html#mindspore.dataset.transforms.RandomOrder) | Consistent | | [torchvision.transforms.RandomPerspective](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomPerspective) | [mindspore.dataset.vision.RandomPerspective](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.RandomPerspective.html#mindspore.dataset.vision.RandomPerspective) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/RandomPerspective.html) | | [torchvision.transforms.RandomResizedCrop](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomResizedCrop) | [mindspore.dataset.vision.RandomResizedCrop](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.RandomResizedCrop.html#mindspore.dataset.vision.RandomResizedCrop) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/RandomResizedCrop.html) | | [torchvision.transforms.RandomRotation](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomRotation) | [mindspore.dataset.vision.RandomRotation](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.RandomRotation.html#mindspore.dataset.vision.RandomRotation) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/RandomRotation.html) | | [torchvision.transforms.RandomVerticalFlip](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.RandomVerticalFlip) | [mindspore.dataset.vision.RandomVerticalFlip](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.RandomVerticalFlip.html#mindspore.dataset.vision.RandomVerticalFlip) | The functions are consistent, but the parameter names are inconsistent. | | [torchvision.transforms.Resize](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.Resize) | [mindspore.dataset.vision.Resize](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.Resize.html#mindspore.dataset.vision.Resize) | Consistent | | [torchvision.transforms.TenCrop](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.TenCrop) | [mindspore.dataset.vision.TenCrop](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.TenCrop.html#mindspore.dataset.vision.TenCrop) | The functions are consistent, but the parameter names are inconsistent. | | [torchvision.transforms.ToPILImage](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.ToPILImage) | [mindspore.dataset.vision.ToPIL](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.ToPIL.html#mindspore.dataset.vision.ToPIL) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/ToPIL.html) | | [torchvision.transforms.ToTensor](https://pytorch.org/vision/0.9/transforms.html#torchvision.transforms.ToTensor) | [mindspore.dataset.vision.ToTensor](https://mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.ToTensor.html#mindspore.dataset.vision.ToTensor) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/ToTensor.html) | | [torchvision.ops.deform_conv2d](https://pytorch.org/vision/main/generated/torchvision.ops.deform_conv2d.html#deform-conv2d) | [mindspore.ops.deformable_conv2d](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.deformable_conv2d.html#mindspore-ops-deformable-conv2d) | [diff](https://www.mindspore.cn/docs/en/master/note/api_mapping/pytorch_diff/deform_conv2d.html) |