Rate this Page

Struct LayerNormFuncOptions#

Struct Documentation#

struct LayerNormFuncOptions#

Options for torch::nn::functional::layer_norm.

Example:

namespace F = torch::nn::functional;
F::layer_norm(input, F::LayerNormFuncOptions({2, 2}).eps(2e-5));

Public Functions

LayerNormFuncOptions(std::vector<int64_t> normalized_shape)#
inline auto normalized_shape(const std::vector<int64_t> &new_normalized_shape) -> decltype(*this)#

input shape from an expected input.

inline auto normalized_shape(std::vector<int64_t> &&new_normalized_shape) -> decltype(*this)#
inline const std::vector<int64_t> &normalized_shape() const noexcept#
inline std::vector<int64_t> &normalized_shape() noexcept#
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 eps(const double &new_eps) -> decltype(*this)#

a value added to the denominator for numerical stability.

Default: 1e-5.

inline auto eps(double &&new_eps) -> decltype(*this)#
inline const double &eps() const noexcept#
inline double &eps() noexcept#