Function torch::special::softmax¶
Defined in File special.h
Function Documentation¶
-
inline Tensor torch::special::softmax(const Tensor &self, int64_t dim, std::optional<ScalarType> dtype)¶
Computes softmax of the input along a given dimension See https://pytorch.org/docs/main/special.html#torch.special.softmax.
Example:
auto t = torch::randn(128, 128, dtype=kDouble); torch::special::softmax(t, 0);