Shortcuts

Struct BatchNormFuncOptions

Page Contents

Struct Documentation

struct BatchNormFuncOptions

Options for torch::nn::functional::batch_norm.

Example:

namespace F = torch::nn::functional;
F::batch_norm(input, mean, variance,
F::BatchNormFuncOptions().weight(weight).bias(bias).momentum(0.1).eps(1e-05).training(false));

Public Functions

inline auto weight(const Tensor &new_weight) -> decltype(*this)
inline auto weight(Tensor &&new_weight) -> decltype(*this)
inline const Tensor &weight() const noexcept
inline Tensor &weight() noexcept
inline auto bias(const Tensor &new_bias) -> decltype(*this)
inline auto bias(Tensor &&new_bias) -> decltype(*this)
inline const Tensor &bias() const noexcept
inline Tensor &bias() 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 momentum(const std::optional<double> &new_momentum) -> decltype(*this)

A momentum multiplier for the mean and variance.

Changing this parameter after construction is effective.

inline auto momentum(std::optional<double> &&new_momentum) -> decltype(*this)
inline const std::optional<double> &momentum() const noexcept
inline std::optional<double> &momentum() noexcept
inline auto eps(const double &new_eps) -> decltype(*this)

The epsilon value added for numerical stability.

Changing this parameter after construction is effective.

inline auto eps(double &&new_eps) -> decltype(*this)
inline const double &eps() const noexcept
inline double &eps() 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