Shortcuts

Function torch::special::log_softmax

Function Documentation

inline Tensor torch::special::log_softmax(const Tensor &self, int64_t dim, std::optional<ScalarType> dtype)

Computes log followed by softmax(x) of the input See https://pytorch.org/docs/main/special.html#torch.special.log_softmax.

Example:

auto t = torch::randn(128, 128, dtype=kDouble);
torch::special::log_softmax(t, 0);

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources