Shortcuts

Struct SoftmaxFuncOptions

Page Contents

Struct Documentation

struct SoftmaxFuncOptions

Options for torch::nn::functional::softmax.

Example:

namespace F = torch::nn::functional;
F::softmax(input, F::SoftmaxFuncOptions(1));

Public Functions

SoftmaxFuncOptions(int64_t dim)
inline auto dim(const int64_t &new_dim) -> decltype(*this)

Dimension along which Softmax will be computed.

inline auto dim(int64_t &&new_dim) -> decltype(*this)
inline const int64_t &dim() const noexcept
inline int64_t &dim() noexcept
inline auto dtype(const c10::optional<torch::Dtype> &new_dtype) -> decltype(*this)

the desired data type of returned tensor.

If specified, the input tensor is casted to dtype before the operation is performed. This is useful for preventing data type overflows. Default: None.

inline auto dtype(c10::optional<torch::Dtype> &&new_dtype) -> decltype(*this)
inline const c10::optional<torch::Dtype> &dtype() const noexcept
inline c10::optional<torch::Dtype> &dtype() noexcept

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