pytorch/test/cpp_api_parity/parity-tracker.md
PyExtreme e1d13f4f8b C++ API parity: NLLLoss & CrossEntropyLoss (#29812)
Summary:
Hi yf225 , I have added **NLLLoss and CrossEntropyLoss.**
```

Also, while using log_softmax in cross_entropy_loss, I am getting an error
../caffe2/../torch/csrc/api/include/torch/nn/functional/loss.h:537:63: error: no matching function for call to  log_softmax(const at::Tensor&)’
     const Tensor& log_softmax_input = torch::log_softmax(input);

aten/src/ATen/Functions.h:5551:22: note: candidate: at::Tensor at::log_softmax(const at::Tensor&, int64_t, c10::optional<c10::ScalarType>)
 static inline Tensor log_softmax(const Tensor & self, int64_t dim, c10::optional<ScalarType> dtype) {
                      ^~~~~~~~~~~
aten/src/ATen/Functions.h:5551:22: note:   candidate expects 3 arguments, 1 provided
```

I think the other two parameters should be optional as in python frontend(shown in documentation here at https://pytorch.org/docs/stable/nn.functional.html#torch.nn.functional.log_softmax ). Rest, there were no errors in build and tests have passed
Pull Request resolved: https://github.com/pytorch/pytorch/pull/29812

Differential Revision: D18548249

Pulled By: yf225

fbshipit-source-id: 2ab350abd2a6f498d4dba2345f51ad87471f3038
2019-11-16 10:49:09 -08:00

4 KiB

Python / C++ API parity tracker

torch.nn

API Implementation Parity Doc Parity
torch.nn.Sequential Yes No
torch.nn.ModuleList Yes No
torch.nn.ModuleDict No No
torch.nn.ParameterList No No
torch.nn.ParameterDict No No
torch.nn.Conv1d Yes No
torch.nn.Conv2d Yes No
torch.nn.Conv3d Yes No
torch.nn.ConvTranspose1d No No
torch.nn.ConvTranspose2d No No
torch.nn.ConvTranspose3d No No
torch.nn.Unfold Yes No
torch.nn.Fold Yes No
torch.nn.MaxPool1d Yes No
torch.nn.MaxPool2d Yes No
torch.nn.MaxPool3d Yes No
torch.nn.MaxUnpool1d Yes No
torch.nn.MaxUnpool2d Yes No
torch.nn.MaxUnpool3d Yes No
torch.nn.AvgPool1d Yes No
torch.nn.AvgPool2d Yes No
torch.nn.AvgPool3d Yes No
torch.nn.FractionalMaxPool2d No No
torch.nn.LPPool1d Yes No
torch.nn.LPPool2d Yes No
torch.nn.AdaptiveMaxPool1d Yes No
torch.nn.AdaptiveMaxPool2d Yes No
torch.nn.AdaptiveMaxPool3d Yes No
torch.nn.AdaptiveAvgPool1d Yes No
torch.nn.AdaptiveAvgPool2d Yes No
torch.nn.AdaptiveAvgPool3d Yes No
torch.nn.ReflectionPad1d Yes No
torch.nn.ReflectionPad2d Yes No
torch.nn.ReplicationPad1d Yes No
torch.nn.ReplicationPad2d Yes No
torch.nn.ReplicationPad3d Yes No
torch.nn.ZeroPad2d Yes No
torch.nn.ConstantPad1d Yes No
torch.nn.ConstantPad2d Yes No
torch.nn.ConstantPad3d Yes No
torch.nn.ELU Yes No
torch.nn.Hardshrink Yes No
torch.nn.Hardtanh Yes No
torch.nn.LeakyReLU Yes No
torch.nn.LogSigmoid Yes No
torch.nn.MultiheadAttention No No
torch.nn.PReLU Yes No
torch.nn.ReLU Yes No
torch.nn.ReLU6 Yes No
torch.nn.RReLU Yes No
torch.nn.SELU Yes No
torch.nn.CELU Yes No
torch.nn.GELU Yes No
torch.nn.Sigmoid Yes No
torch.nn.Softplus Yes No
torch.nn.Softshrink Yes No
torch.nn.Softsign Yes No
torch.nn.Tanh Yes No
torch.nn.Tanhshrink Yes No
torch.nn.Threshold Yes No
torch.nn.GLU No No
torch.nn.Softmin Yes No
torch.nn.Softmax Yes No
torch.nn.Softmax2d Yes No
torch.nn.LogSoftmax Yes No
torch.nn.AdaptiveLogSoftmaxWithLoss No No
torch.nn.BatchNorm1d Yes No
torch.nn.BatchNorm2d Yes No
torch.nn.BatchNorm3d Yes No
torch.nn.GroupNorm No No
torch.nn.SyncBatchNorm No No
torch.nn.InstanceNorm1d No No
torch.nn.InstanceNorm2d No No
torch.nn.InstanceNorm3d No No
torch.nn.LayerNorm Yes No
torch.nn.LocalResponseNorm Yes No
torch.nn.CrossMapLRN2d Yes No
torch.nn.RNN No No
torch.nn.LSTM No No
torch.nn.GRU No No
torch.nn.RNNCell No No
torch.nn.LSTMCell No No
torch.nn.GRUCell No No
torch.nn.Transformer No No
torch.nn.TransformerEncoder No No
torch.nn.TransformerDecoder No No
torch.nn.TransformerEncoderLayer No No
torch.nn.TransformerDecoderLayer No No
torch.nn.Identity Yes No
torch.nn.Linear Yes No
torch.nn.Bilinear Yes No
torch.nn.Flatten Yes No
torch.nn.Dropout Yes No
torch.nn.Dropout2d Yes No
torch.nn.Dropout3d Yes No
torch.nn.AlphaDropout No No
torch.nn.Embedding Yes No
torch.nn.EmbeddingBag Yes No
torch.nn.CosineSimilarity Yes No
torch.nn.PairwiseDistance Yes No
torch.nn.L1Loss Yes No
torch.nn.MSELoss Yes No
torch.nn.CrossEntropyLoss Yes No
torch.nn.CTCLoss Yes No
torch.nn.NLLLoss Yes No
torch.nn.PoissonNLLLoss Yes No
torch.nn.KLDivLoss Yes No
torch.nn.BCELoss Yes No
torch.nn.BCEWithLogitsLoss No No
torch.nn.MarginRankingLoss Yes No
torch.nn.HingeEmbeddingLoss Yes No
torch.nn.MultiLabelMarginLoss Yes No
torch.nn.SmoothL1Loss Yes No
torch.nn.SoftMarginLoss Yes No
torch.nn.MultiLabelSoftMarginLoss Yes No
torch.nn.CosineEmbeddingLoss Yes No
torch.nn.MultiMarginLoss Yes No
torch.nn.TripletMarginLoss Yes No
torch.nn.PixelShuffle Yes No
torch.nn.Upsample Yes No
torch.nn.DataParallel No No
torch.nn.parallel.DistributedDataParallel No No
torch.nn.utils.clip_grad_norm_ Yes No
torch.nn.utils.clip_grad_value_ No No
torch.nn.utils.parameters_to_vector No No
torch.nn.utils.vector_to_parameters No No
torch.nn.utils.weight_norm No No
torch.nn.utils.remove_weight_norm No No
torch.nn.utils.spectral_norm No No
torch.nn.utils.remove_spectral_norm No No
torch.nn.utils.rnn.PackedSequence No No
torch.nn.utils.rnn.pack_padded_sequence No No
torch.nn.utils.rnn.pad_packed_sequence No No
torch.nn.utils.rnn.pad_sequence No No
torch.nn.utils.rnn.pack_sequence No No
torch.nn.FractionalMaxPool3d No No
torch.nn.SampleModule Yes Yes