Shortcuts

Struct DropoutFuncOptions

Page Contents

Struct Documentation

struct DropoutFuncOptions

Options for torch::nn::functional::dropout.

Example:

namespace F = torch::nn::functional;
F::dropout(input, F::DropoutFuncOptions().p(0.5));

Public Functions

inline auto p(const double &new_p) -> decltype(*this)

The probability of an element to be zeroed. Default: 0.5.

inline auto p(double &&new_p) -> decltype(*this)
inline const double &p() const noexcept
inline double &p() noexcept
inline auto training(const bool &new_training) -> decltype(*this)
inline auto training(bool &&new_training) -> decltype(*this)
inline const bool &training() const noexcept
inline bool &training() noexcept
inline auto inplace(const bool &new_inplace) -> decltype(*this)

can optionally do the operation in-place. Default: False

inline auto inplace(bool &&new_inplace) -> decltype(*this)
inline const bool &inplace() const noexcept
inline bool &inplace() 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