PyTorch and MindSpore API Mapping Table

Mapping between TensorFlow APIs and MindSpore APIs, which is provided by the community. There may be differences in parameters, inputs, outputs, logic functions, and specific scenarios. For details, see the description of each API or the difference comparison provided.

More MindSpore developers are also welcome to participate in improving the mapping content.

PyTorch 1.8.1

torch

PyTorch 1.8.1 APIs

MindSpore APIs

Descriptions

torch.abs

mindspore.ops.abs

Difference comparison is under development.

torch.acos

mindspore.ops.acos

Difference comparison is under development.

torch.add

mindspore.ops.add

Difference comparison is under development.

torch.addbmm

mindspore.ops.addbmm

The functions are consistent, but the parameter names are inconsistent.

torch.addmm

mindspore.ops.addmm

The functions are consistent, but the parameter names are inconsistent.

torch.angle

mindspore.ops.angle

The functions are consistent.

torch.arccosh

mindspore.ops.arccosh

The functions are consistent, but the parameter names are inconsistent.

torch.arcsin

mindspore.ops.arcsin

The functions are consistent, but the parameter names are inconsistent.

torch.arctan

mindspore.ops.arctan

The functions are consistent, but the parameter names are inconsistent.

torch.asin

mindspore.ops.asin

Difference comparison is under development.

torch.atan

mindspore.ops.atan

Difference comparison is under development.

torch.atan2

mindspore.ops.atan2

Difference comparison is under development.

torch.baddbmm

mindspore.ops.baddbmm

The functions are consistent, but the parameter names are inconsistent.

torch.bartlett_window

mindspore.ops.bartlett_window

Difference comparison is under development.

torch.bitwise_and

mindspore.ops.bitwise_and

Difference comparison is under development.

torch.bitwise_or

mindspore.ops.bitwise_or

Difference comparison is under development.

torch.bitwise_xor

mindspore.ops.bitwise_xor

Difference comparison is under development.

torch.blackman_window

mindspore.ops.blackman_window

Difference comparison is under development.

torch.bmm

mindspore.ops.BatchMatMul

Difference comparison is under development.

torch.broadcast_to

mindspore.ops.broadcast_to

Difference comparison is under development.

torch.ceil

mindspore.ops.ceil

Difference comparison is under development.

torch.conj

mindspore.ops.conj

Difference comparison is under development.

torch.cos

mindspore.ops.cos

Difference comparison is under development.

torch.cosh

mindspore.ops.cosh

Difference comparison is under development.

torch.cross

mindspore.numpy.cross

diff

torch.cumprod

mindspore.ops.cumprod

Difference comparison is under development.

torch.cumsum

mindspore.ops.cumsum

Difference comparison is under development.

torch.div

mindspore.ops.div

Difference comparison is under development.

torch.divide

mindspore.ops.divide

The functions are consistent.

torch.empty

mindspore.numpy.empty

Difference comparison is under development.

torch.empty_like

mindspore.numpy.empty_like

Difference comparison is under development.

torch.eq

mindspore.ops.equal

Difference comparison is under development.

torch.erfc

mindspore.ops.erfc

Difference comparison is under development.

torch.erfinv

mindspore.ops.erfinv

Difference comparison is under development.

torch.exp

mindspore.ops.exp

Difference comparison is under development.

torch.expm1

mindspore.ops.expm1

Difference comparison is under development.

torch.eye

mindspore.ops.eye

Difference comparison is under development.

torch.flip

mindspore.ops.flip

Difference comparison is under development.

torch.fliplr

mindspore.ops.fliplr

Difference comparison is under development.

torch.flipud

mindspore.ops.flipud

Difference comparison is under development.

torch.full

mindspore.numpy.full

Difference comparison is under development.

torch.full_like

mindspore.numpy.full_like

Difference comparison is under development.

torch.hann_window

mindspore.numpy.hanning

Difference comparison is under development.

torch.is_floating_point

mindspore.ops.is_floating_point

Difference comparison is under development.

torch.negative

mindspore.ops.negative

The functions are consistent, but the parameter names are inconsistent.

torch.numel

mindspore.ops.numel

The functions are consistent, but the parameter names are inconsistent.

torch.roll

mindspore.ops.roll

Difference comparison is under development.

torch.unsqueeze

mindspore.ops.expand_dims

Difference comparison is under development.

torch.distributed

PyTorch 1.8.1 APIs

MindSpore APIs

Descriptions

torch.distributed.all_gather

mindspore.ops.AllGather

diff

torch.distributed.all_reduce

mindspore.ops.AllReduce

diff

torch.distributed.get_rank

mindspore.communication.get_rank

diff

torch.distributed.init_process_group

mindspore.communication.init

diff

torch.distributed.new_group

mindspore.communication.create_group

diff

torch.nn

PyTorch 1.8.1 APIs

MindSpore APIs

Descriptions

torch.nn.AdaptiveAvgPool2d

mindspore.nn.AdaptiveAvgPool2d

Difference comparison is under development.

torch.nn.AvgPool1d

mindspore.nn.AvgPool1d

Difference comparison is under development.

torch.nn.AvgPool2d

mindspore.nn.AvgPool2d

Difference comparison is under development.

torch.nn.AvgPool3d

mindspore.nn.AvgPool3d

Difference comparison is under development.

torch.nn.BCEWithLogitsLoss

mindspore.nn.BCEWithLogitsLoss

Difference comparison is under development.

torch.nn.BatchNorm1d

mindspore.nn.BatchNorm1d

diff

torch.nn.BatchNorm2d

mindspore.nn.BatchNorm2d

diff

torch.nn.CTCLoss

mindspore.nn.CTCLoss

The functions are consistent.

torch.nn.Conv1d

mindspore.nn.Conv1d

Difference comparison is under development.

torch.nn.Conv2d

mindspore.nn.Conv2d

Difference comparison is under development.

torch.nn.Conv3d

mindspore.nn.Conv3d

Difference comparison is under development.

torch.nn.ConvTranspose1d

mindspore.nn.Conv1dTranspose

Difference comparison is under development.

torch.nn.ConvTranspose2d

mindspore.nn.Conv2dTranspose

Difference comparison is under development.

torch.nn.ConvTranspose3d

mindspore.nn.Conv3dTranspose

Difference comparison is under development.

torch.nn.CosineEmbeddingLoss

mindspore.nn.CosineEmbeddingLoss

Difference comparison is under development.

torch.nn.CrossEntropyLoss

mindspore.nn.CrossEntropyLoss

Difference comparison is under development.

torch.nn.Dropout

mindspore.nn.Dropout

diff

torch.nn.Dropout

mindspore.ops.dropout

Difference comparison is under development.

torch.nn.FractionalMaxPool2d

mindspore.nn.FractionalMaxPool2d

The functions are consistent.

torch.nn.GELU

mindspore.nn.GELU

Difference comparison is under development.

torch.nn.GRU

mindspore.nn.GRU

Difference comparison is under development.

torch.nn.GroupNorm

mindspore.nn.GroupNorm

Difference comparison is under development.

torch.nn.Hardshrink

mindspore.nn.HShrink

Difference comparison is under development.

torch.nn.L1Loss

mindspore.nn.L1Loss

Difference comparison is under development.

torch.nn.LPPool1d

mindspore.nn.LPPool1d

Difference comparison is under development.

torch.nn.LPPool2d

mindspore.nn.LPPool2d

Difference comparison is under development.

torch.nn.LSTM

mindspore.nn.LSTM

Difference comparison is under development.

torch.nn.LSTMCell

mindspore.nn.LSTMCell

Difference comparison is under development.

torch.nn.LayerNorm

mindspore.nn.LayerNorm

Difference comparison is under development.

torch.nn.LeakyReLU

mindspore.nn.LeakyReLU

Difference comparison is under development.

torch.nn.Linear

mindspore.nn.Dense

diff

torch.nn.MSELoss

mindspore.nn.MSELoss

Difference comparison is under development.

torch.nn.MarginRankingLoss

mindspore.nn.MarginRankingLoss

Difference comparison is under development.

torch.nn.MaxPool1d

mindspore.nn.MaxPool1d

diff

torch.nn.MaxPool2d

mindspore.nn.MaxPool2d

diff

torch.nn.MaxPool3d

mindspore.nn.MaxPool3d

The functions are consistent.

torch.nn.PReLU

mindspore.nn.PReLU

Difference comparison is under development.

torch.nn.PixelShuffle

mindspore.nn.PixelShuffle

The functions are consistent.

torch.nn.PixelUnshuffle

mindspore.nn.PixelUnshuffle

The functions are consistent.

torch.nn.ReLU

mindspore.nn.ReLU

Difference comparison is under development.

torch.nn.Sigmoid

mindspore.nn.Sigmoid

Difference comparison is under development.

torch.nn.SmoothL1Loss

mindspore.nn.SmoothL1Loss

Difference comparison is under development.

torch.nn.Softmax

mindspore.nn.Softmax

Difference comparison is under development.

torch.nn.Softshrink

mindspore.nn.SoftShrink

Difference comparison is under development.

torch.nn.Tanh

mindspore.nn.Tanh

Difference comparison is under development.

torch.nn.Unfold

mindspore.nn.Unfold

diff

torch.nn.functional

PyTorch 1.8.1 APIs

MindSpore APIs

Descriptions

torch.nn.functional.binary_cross_entropy

mindspore.nn.BCELoss

Difference comparison is under development.

torch.nn.functional.elu

mindspore.ops.elu

Difference comparison is under development.

torch.nn.functional.l1_loss

mindspore.nn.L1Loss

Difference comparison is under development.

torch.nn.functional.lp_pool1d

mindspore.ops.lp_pool1d

Difference comparison is under development.

torch.nn.functional.lp_pool2d

mindspore.ops.lp_pool2d

Difference comparison is under development.

torch.nn.functional.margin_ranking_loss

mindspore.ops.margin_ranking_loss

Difference comparison is under development.

torch.nn.functional.mse_loss

mindspore.nn.MSELoss

Difference comparison is under development.

torch.nn.functional.pad

mindspore.ops.pad

diff

torch.nn.functional.pixel_shuffle

mindspore.ops.pixel_shuffle

The functions are consistent, but the parameter names are inconsistent.

torch.nn.functional.pixel_unshuffle

mindspore.ops.pixel_unshuffle

The functions are consistent, but the parameter names are inconsistent.

torch.nn.functional.soft_margin_loss

mindspore.nn.SoftMarginLoss

Difference comparison is under development.

torch.Tensor

PyTorch 1.8.1 APIs

MindSpore APIs

Descriptions

torch.Tensor.addbmm

mindspore.Tensor.addbmm

The functions are consistent.

torch.Tensor.addmm

mindspore.Tensor.addmm

The functions are consistent.

torch.Tensor.arccosh

mindspore.Tensor.arccosh

The functions are consistent.

torch.Tensor.angle

mindspore.Tensor.angle

The functions are consistent.

torch.Tensor.arcsin

mindspore.Tensor.arcsin

The functions are consistent.

torch.Tensor.arcsinh

mindspore.Tensor.arcsinh

Difference comparison is under development.

torch.Tensor.arctan

mindspore.Tensor.arctan

The functions are consistent.

torch.Tensor.arctanh

mindspore.Tensor.arctanh

Difference comparison is under development.

torch.Tensor.copysign

mindspore.Tensor.copysign

The functions are consistent.

torch.Tensor.deg2rad

mindspore.Tensor.deg2rad

The functions are consistent.

torch.Tensor.divide

mindspore.Tensor.divide

The functions are consistent.

torch.Tensor.flip

mindspore.Tensor.flip

Difference comparison is under development.

torch.Tensor.fliplr

mindspore.Tensor.fliplr

Difference comparison is under development.

torch.Tensor.flipud

mindspore.Tensor.flipud

Difference comparison is under development.

torch.Tensor.is_floating_point

mindspore.Tensor.is_floating_point

Difference comparison is under development.

torch.Tensor.is_signed

mindspore.Tensor.is_signed

Difference comparison is under development.

torch.Tensor.lcm

mindspore.Tensor.lcm

The functions are consistent.

torch.Tensor.ldexp

mindspore.Tensor.ldexp

The functions are consistent.

torch.Tensor.logaddexp

mindspore.Tensor.logaddexp

The functions are consistent.

torch.Tensor.logaddexp2

mindspore.Tensor.logaddexp2

The functions are consistent.

torch.Tensor.logsumexp

mindspore.Tensor.logsumexp

The functions are consistent.

torch.Tensor.negative

mindspore.Tensor.negative

The functions are consistent.

torch.Tensor.nelement

mindspore.Tensor.nelement

The functions are consistent.

torch.Tensor.numel

mindspore.Tensor.numel

The functions are consistent.

torch.Tensor.permute

mindspore.Tensor.permute

The functions are consistent.

torch.Tensor.remainder

mindspore.Tensor.remainder

The functions are consistent.

torch.Tensor.rad2deg

mindspore.Tensor.rad2deg

The functions are consistent.

torch.Tensor.repeat_interleave

mindspore.Tensor.repeat_interleave

Difference comparison is under development.

torch.Tensor.reshape_as

mindspore.Tensor.reshape_as

Difference comparison is under development.

torch.Tensor.roll

mindspore.Tensor.roll

Difference comparison is under development.

torch.Tensor.rot90

mindspore.Tensor.rot90

Difference comparison is under development.

torch.Tensor.short

mindspore.Tensor.short

Difference comparison is under development.

torch.optim

PyTorch 1.8.1 APIs

MindSpore APIs

Descriptions

torch.optim.lr_scheduler.CosineAnnealingLR

mindspore.nn.cosine_decay_lr

diff

torch.optim.lr_scheduler.ExponentialLR

mindspore.nn.exponential_decay_lr

diff

torch.optim.lr_scheduler.MultiStepLR

mindspore.nn.piecewise_constant_lr

diff

torch.optim.lr_scheduler.StepLR

mindspore.nn.piecewise_constant_lr

diff

torch.utils

PyTorch 1.8.1 APIs

MindSpore APIs

Descriptions

torch.utils.data.DataLoader

None

diff

torch.utils.data.Dataset

mindspore.dataset.GeneratorDataset

diff

torch.utils.data.distributed.DistributedSampler

mindspore.dataset.DistributedSampler

torch.utils.data.RandomSampler

mindspore.dataset.RandomSampler

torch.utils.data.SequentialSampler

mindspore.dataset.SequentialSampler

torch.utils.data.SubsetRandomSampler

mindspore.dataset.SubsetRandomSampler

torch.utils.data.WeightedRandomSampler

mindspore.dataset.WeightedRandomSampler

PyTorch 1.5.0

torch

PyTorch 1.5.0 APIs

MindSpore APIs

Descriptions

torch.arange

mindspore.numpy.arange

torch.argmax

mindspore.ops.argmax

torch.argmin

mindspore.ops.argmin

torch.argsort

mindspore.ops.Sort

diff

torch.bincount

mindspore.numpy.bincount

torch.broadcast_tensors

mindspore.ops.BroadcastTo

diff

torch.chunk

mindspore.ops.Split

torch.diagflat

mindspore.numpy.diagflat

torch.diagonal

mindspore.numpy.diagonal

torch.dot

mindspore.ops.tensor_dot

diff

torch.flatten

mindspore.ops.Flatten

diff

torch.flip

mindspore.ops.ReverseV2

torch.floor

mindspore.ops.Floor

torch.floor_divide

mindspore.ops.FloorDiv

diff

torch.fmod

mindspore.ops.Mod

torch.from_numpy

mindspore.Tensor.from_numpy

torch.gather

mindspore.ops.GatherD

torch.ge

mindspore.ops.GreaterEqual

torch.gt

mindspore.ops.Greater

torch.hamming_window

mindspore.numpy.hamming

torch.histc

mindspore.ops.HistogramFixedWidth

torch.imag

mindspore.ops.Imag

torch.isfinite

mindspore.ops.IsFinite

torch.isinf

mindspore.ops.IsInf

torch.isnan

mindspore.ops.IsNan

torch.le

mindspore.ops.LessEqual

torch.lerp

mindspore.ops.Lerp

torch.linspace

mindspore.ops.LinSpace

torch.load

mindspore.load_checkpoint

torch.log

mindspore.ops.Log

torch.log1p

mindspore.ops.Log1p

torch.log2

mindspore.numpy.log2

torch.logical_and

mindspore.ops.LogicalAnd

diff

torch.logical_not

mindspore.numpy.logical_not

diff

torch.logical_or

mindspore.ops.LogicalOr

diff

torch.logical_xor

mindspore.numpy.logical_xor

diff

torch.logspace

mindspore.numpy.logspace

torch.lt

mindspore.ops.Less

torch.matmul

mindspore.ops.MatMul

torch.matrix_power

mindspore.numpy.matrix_power

torch.matrix_rank

mindspore.ops.Rank

torch.max

mindspore.ops.ArgMaxWithValue

diff

torch.mean

mindspore.ops.ReduceMean

torch.meshgrid

mindspore.ops.Meshgrid

torch.min

mindspore.ops.ArgMinWithValue

diff

torch.mm

mindspore.ops.MatMul

torch.mul

mindspore.ops.Mul

torch.multinomial

mindspore.ops.multinomial

torch.ne

mindspore.ops.NotEqual

torch.neg

mindspore.ops.Neg

torch.norm

mindspore.ops.LpNorm

diff

torch.numel

mindspore.ops.Size

torch.ones

mindspore.ops.Ones

torch.ones_like

mindspore.ops.OnesLike

torch.pow

mindspore.ops.Pow

torch.prod

mindspore.ops.ReduceProd

torch.promote_types

mindspore.numpy.promote_types

torch.rand

mindspore.ops.UniformReal

torch.rand_like

mindspore.ops.UniformReal

torch.randint

mindspore.ops.UniformInt

torch.randint_like

mindspore.ops.UniformInt

torch.randn

mindspore.ops.StandardNormal

torch.randperm

mindspore.ops.Randperm

diff

torch.real

mindspore.ops.Real

torch.reciprocal

mindspore.ops.Reciprocal

torch.remainder

mindspore.numpy.remainder

torch.reshape

mindspore.ops.Reshape

torch.result_type

mindspore.numpy.result_type

torch.rot90

mindspore.numpy.rot90

torch.round

mindspore.ops.Rint

torch.rsqrt

mindspore.ops.Rsqrt

torch.save

mindspore.save_checkpoint

torch.sigmoid

mindspore.ops.Sigmoid

torch.sin

mindspore.ops.Sin

torch.sinh

mindspore.ops.Sinh

torch.sort

mindspore.ops.Sort

torch.sparse_coo_tensor

mindspore.SparseTensor

diff

torch.split

mindspore.ops.Split

torch.sqrt

mindspore.ops.Sqrt

torch.square

mindspore.ops.Square

torch.squeeze

mindspore.ops.Squeeze

torch.stack

mindspore.ops.Stack

torch.std

mindspore.Tensor.std

torch.std_mean

mindspore.ops.ReduceMean

diff

torch.sum

mindspore.ops.ReduceSum

torch.take

mindspore.Tensor.take

torch.tan

mindspore.ops.Tan

torch.tanh

mindspore.ops.Tanh

torch.tensor

mindspore.Tensor

torch.Tensor

mindspore.Tensor

torch.tensordot

mindspore.numpy.tensordot

torch.topk

mindspore.ops.TopK

diff

torch.trace

mindspore.Tensor.trace

torch.transpose

mindspore.Tensor.transpose

Difference comparison is under development.

torch.trapz

mindspore.numpy.trapz

torch.tril_indices

mindspore.numpy.tril_indices

torch.triu_indices

mindspore.numpy.triu_indices

torch.true_divide

mindspore.numpy.true_divide

torch.trunc

mindspore.numpy.trunc

torch.unbind

mindspore.ops.Unstack

torch.unique

mindspore.ops.Unique

diff

torch.var

mindspore.Tensor.var

torch.where

mindspore.numpy.where

torch.zeros

mindspore.ops.Zeros

torch.zeros_like

mindspore.ops.ZerosLike

torch.autograd

PyTorch 1.5.0 APIs

MindSpore APIs

Descriptions

torch.autograd.backward

mindspore.grad

diff

torch.autograd.enable_grad

mindspore.ops.stop_gradient

diff

torch.autograd.grad

mindspore.grad

diff

torch.autograd.no_grad

mindspore.ops.stop_gradient

diff

torch.autograd.variable

mindspore.Parameter

torch.cuda

PyTorch 1.5.0 APIs

MindSpore APIs

Descriptions

torch.cuda.device_count

mindspore.communication.get_group_size

torch.cuda.set_device

mindspore.set_context

diff

torch.distributions

PyTorch 1.5.0 APIs

MindSpore APIs

Descriptions

torch.distributions.gamma.Gamma

mindspore.ops.Gamma

torch.nn

PyTorch 1.5.0 APIs

MindSpore APIs

Descriptions

torch.nn.Embedding

mindspore.nn.Embedding

diff

torch.nn.Flatten

mindspore.nn.Flatten

diff

torch.nn.GELU

mindspore.nn.FastGelu

diff

torch.nn.KLDivLoss

mindspore.ops.KLDivLoss

torch.nn.MaxPool3d

mindspore.ops.MaxPool3D

diff

torch.nn.MultiheadAttention

mindspore.nn.transformer.MultiHeadAttention

Difference comparison is under development.

torch.nn.Module

mindspore.nn.Cell

torch.nn.Module.add_module

mindspore.nn.Cell.insert_child_to_cell

torch.nn.Module.children

mindspore.nn.Cell.cells

diff

torch.nn.Module.load_state_dict

mindspore.load_param_into_net

torch.nn.Module.named_children

mindspore.nn.Cell.name_cells

diff

torch.nn.Module.named_modules

mindspore.nn.Cell.cells_and_names

torch.nn.Module.state_dict

mindspore.nn.Cell.parameters_dict

torch.nn.Module.train

mindspore.nn.Cell.set_train

torch.nn.ModuleList

mindspore.nn.CellList

torch.nn.NLLLoss

mindspore.ops.NLLLoss

diff

torch.nn.Parameter

mindspore.Parameter

torch.nn.ParameterList

mindspore.ParameterTuple

diff

torch.nn.ReplicationPad2d

mindspore.nn.Pad

torch.nn.SELU

mindspore.ops.SeLU

torch.nn.Sequential

mindspore.nn.SequentialCell

torch.nn.SyncBatchNorm.convert_sync_batchnorm

mindspore.nn.SyncBatchNorm

torch.nn.Transformer

mindspore.nn.transformer.Transformer

Difference comparison is under development.

torch.nn.TransformerEncoder

mindspore.nn.transformer.TransformerEncoder

torch.nn.TransformerDecoder

mindspore.nn.transformer.TransformerDecoder

Difference comparison is under development.

torch.nn.TransformerEncoderLayer

mindspore.nn.transformer.TransformerEncoderLayer

Difference comparison is under development.

torch.nn.TransformerDecoderLayer

mindspore.nn.transformer.TransformerDecoderLayer

Difference comparison is under development.

torch.nn.Upsample

mindspore.nn.ResizeBilinear

diff

torch.nn.functional

PyTorch 1.5.0 APIs

MindSpore APIs

Descriptions

torch.nn.functional.adaptive_avg_pool2d

mindspore.nn.AdaptiveAvgPool2d

torch.nn.functional.avg_pool1d

mindspore.nn.AvgPool1d

torch.nn.functional.avg_pool2d

mindspore.ops.AvgPool

torch.nn.functional.avg_pool3d

mindspore.ops.AvgPool3D

torch.nn.functional.batch_norm

mindspore.ops.BatchNorm

torch.nn.functional.conv2d

mindspore.ops.Conv2D

torch.nn.functional.cosine_embedding_loss

mindspore.nn.CosineEmbeddingLoss

torch.nn.functional.ctc_loss

mindspore.ops.CTCLoss

torch.nn.functional.kl_div

mindspore.ops.KLDivLoss

torch.nn.functional.layer_norm

mindspore.ops.LayerNorm

torch.nn.functional.leaky_relu

mindspore.nn.LeakyReLU

torch.nn.functional.log_softmax

mindspore.nn.LogSoftmax

torch.nn.functional.normalize

mindspore.ops.L2Normalize

diff

torch.nn.functional.one_hot

mindspore.ops.OneHot

torch.nn.functional.relu

mindspore.ops.ReLU

torch.nn.functional.smooth_l1_loss

mindspore.nn.SmoothL1Loss

torch.nn.functional.softmax

mindspore.ops.Softmax

diff

torch.nn.functional.softplus

mindspore.ops.Softplus

torch.nn.functional.softsign

mindspore.ops.Softsign

torch.nn.init

PyTorch 1.5.0 APIs

MindSpore APIs

Descriptions

torch.nn.init.constant_

mindspore.common.initializer.Constant

diff

torch.nn.init.kaiming_normal_

mindspore.common.initializer.HeNormal

torch.nn.init.kaiming_uniform_

mindspore.common.initializer.HeUniform

torch.nn.init.normal_

mindspore.common.initializer.Normal

diff

torch.nn.init.ones_

mindspore.common.initializer.One

torch.nn.init.xavier_uniform_

mindspore.common.initializer.XavierUniform

torch.nn.init.zeros_

mindspore.common.initializer.Zero

torch.nn.init.uniform_

mindspore.common.initializer.Uniform

diff

torch.optim

PyTorch 1.5.0 APIs

MindSpore APIs

Descriptions

torch.optim.Adadelta

mindspore.ops.ApplyAdadelta

diff

torch.optim.Adagrad

mindspore.nn.Adagrad

diff

torch.optim.Adam

mindspore.nn.Adam

torch.optim.Adamax

mindspore.ops.ApplyAdaMax

torch.optim.AdamW

mindspore.nn.AdamWeightDecay

diff

torch.optim.Optimizer

mindspore.nn.Optimizer

diff

torch.optim.Optimizer.step

mindspore.nn.TrainOneStepCell

diff

torch.optim.RMSprop

mindspore.nn.RMSProp

torch.optim.SGD

mindspore.nn.SGD

torch.Tensor

PyTorch 1.5.0 APIs

MindSpore APIs

Descriptions

torch.BoolTensor.all

mindspore.Tensor.all

torch.BoolTensor.any

mindspore.Tensor.any

torch.Tensor.abs

mindspore.Tensor.abs

torch.Tensor.argmax

mindspore.Tensor.argmax

torch.Tensor.argmin

mindspore.Tensor.argmin

torch.Tensor.chunk

mindspore.ops.Split

torch.Tensor.copy_

mindspore.Tensor.copy

torch.Tensor.cuda

mindspore.set_context

diff

torch.Tensor.cumsum

mindspore.Tensor.cumsum

torch.Tensor.diagonal

mindspore.Tensor.diagonal

torch.Tensor.dtype

mindspore.Tensor.dtype

torch.Tensor.expand

mindspore.ops.BroadcastTo

torch.Tensor.expand_as

mindspore.Tensor.expand_as

torch.Tensor.fill_

mindspore.ops.Fill

torch.Tensor.flatten

mindspore.Tensor.flatten

torch.Tensor.float

mindspore.ops.Cast

diff

torch.Tensor.index_add

mindspore.ops.InplaceAdd

torch.Tensor.item

mindspore.Tensor.item

diff

torch.Tensor.max

mindspore.Tensor.max

torch.Tensor.mean

mindspore.Tensor.mean

torch.Tensor.min

mindspore.Tensor.min

torch.Tensor.mm

mindspore.ops.MatMul

torch.Tensor.mul

mindspore.ops.Mul

torch.Tensor.ndim

mindspore.Tensor.ndim

torch.Tensor.new_full

mindspore.numpy.full

torch.Tensor.new_zeros

mindspore.ops.Zeros

torch.Tensor.numpy

mindspore.Tensor.asnumpy

torch.Tensor.pow

mindspore.ops.Pow

torch.Tensor.permute

mindspore.ops.Transpose

torch.Tensor.repeat

mindspore.numpy.tile

diff

torch.Tensor.requires_grad_

mindspore.Parameter.requires_grad

torch.Tensor.reshape_as

mindspore.Tensor.reshape

torch.Tensor.resize_

mindspore.Tensor.resize

torch.Tensor.round

mindspore.ops.Round

torch.Tensor.scatter_add_

mindspore.ops.ScatterNdAdd

diff

torch.Tensor.sigmoid

mindspore.nn.Sigmoid

torch.Tensor.sign

mindspore.ops.Sign

torch.Tensor.size

mindspore.Tensor.shape

torch.Tensor.sqrt

mindspore.ops.Sqrt

torch.Tensor.stride

mindspore.Tensor.strides

diff

torch.Tensor.squeeze

mindspore.Tensor.squeeze

torch.Tensor.sub

mindspore.ops.Sub

torch.Tensor.sum

mindspore.Tensor.sum

Difference comparison is under development.

torch.Tensor.t

mindspore.ops.Transpose

diff

torch.Tensor.t

mindspore.Tensor.T

torch.Tensor.transpose

mindspore.Tensor.transpose

torch.Tensor.unsqueeze

mindspore.ops.ExpandDims

torch.Tensor.view

mindspore.Tensor.view

torch.Tensor.view_as

mindspore.Tensor.view

torch.Tensor.zero_

mindspore.ops.ZerosLike

torchtext

TorchText 0.10.0 APIs

MindSpore APIs

Descriptions

torchtext.data.functional.custom_replace

mindspore.dataset.text.RegexReplace

torchtext.data.functional.load_sp_model

mindspore.dataset.text.SentencePieceVocab

diff

torchtext.data.functional.numericalize_tokens_from_iterator

mindspore.dataset.text.Lookup

diff

torchtext.data.functional.sentencepiece_numericalizer

mindspore.dataset.text.SentencePieceTokenizer

diff

torchtext.data.functional.sentencepiece_tokenizer

mindspore.dataset.text.SentencePieceTokenizer

diff

torchtext.data.functional.simple_space_split

mindspore.dataset.text.WhitespaceTokenizer

torchtext.data.utils.ngrams_iterator

mindspore.dataset.text.Ngram

diff

torchvision

TorchVision 0.10.0 APIs

MindSpore APIs

Descriptions

torchvision.datasets.CelebA

mindspore.dataset.CelebADataset

torchvision.datasets.CIFAR10

mindspore.dataset.Cifar10Dataset

torchvision.datasets.CIFAR100

mindspore.dataset.Cifar100Dataset

torchvision.datasets.CocoDetection

mindspore.dataset.CocoDataset

diff

torchvision.datasets.ImageFolder

mindspore.dataset.ImageFolderDataset

torchvision.datasets.MNIST

mindspore.dataset.MnistDataset

torchvision.datasets.VOCDetection

mindspore.dataset.VOCDataset

diff

torchvision.datasets.VOCSegmentation

mindspore.dataset.VOCDataset

diff

torchvision.ops.nms

mindspore.ops.NMSWithMask

torchvision.ops.roi_align

mindspore.ops.ROIAlign

torchvision.transforms.CenterCrop

mindspore.dataset.vision.CenterCrop

torchvision.transforms.ColorJitter

mindspore.dataset.vision.RandomColorAdjust

torchvision.transforms.Compose

mindspore.dataset.transforms.Compose

torchvision.transforms.ConvertImageDtype

mindspore.dataset.transforms.TypeCast

diff

torchvision.transforms.FiveCrop

mindspore.dataset.vision.FiveCrop

torchvision.transforms.GaussianBlur

mindspore.dataset.vision.GaussianBlur

torchvision.transforms.Grayscale

mindspore.dataset.vision.Grayscale

torchvision.transforms.LinearTransformation

mindspore.dataset.vision.LinearTransformation

torchvision.transforms.Normalize

mindspore.dataset.vision.Normalize

torchvision.transforms.Pad

mindspore.dataset.vision.Pad

torchvision.transforms.RandomAffine

mindspore.dataset.vision.RandomAffine

torchvision.transforms.RandomApply

mindspore.dataset.transforms.RandomApply

torchvision.transforms.RandomChoice

mindspore.dataset.transforms.RandomChoice

torchvision.transforms.RandomCrop

mindspore.dataset.vision.RandomCrop

torchvision.transforms.RandomErasing

mindspore.dataset.vision.RandomErasing

torchvision.transforms.RandomGrayscale

mindspore.dataset.vision.RandomGrayscale

torchvision.transforms.RandomHorizontalFlip

mindspore.dataset.vision.RandomHorizontalFlip

torchvision.transforms.RandomOrder

mindspore.dataset.transforms.RandomOrder

torchvision.transforms.RandomPerspective

mindspore.dataset.vision.RandomPerspective

torchvision.transforms.RandomPosterize

mindspore.dataset.vision.RandomPosterize

torchvision.transforms.RandomResizedCrop

mindspore.dataset.vision.RandomResizedCrop

torchvision.transforms.RandomRotation

mindspore.dataset.vision.RandomRotation

torchvision.transforms.RandomSolarize

mindspore.dataset.vision.RandomSolarize

diff

torchvision.transforms.RandomVerticalFlip

mindspore.dataset.vision.RandomVerticalFlip

torchvision.transforms.Resize

mindspore.dataset.vision.Resize

torchvision.transforms.TenCrop

mindspore.dataset.vision.TenCrop

torchvision.transforms.ToPILImage

mindspore.dataset.vision.ToPIL

diff

torchvision.transforms.ToTensor

mindspore.dataset.vision.ToTensor

diff