Shortcuts

Struct LayerNormFuncOptions

Page Contents

Struct Documentation

struct torch::nn::functional::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)
auto normalized_shape(const std::vector<int64_t> &new_normalized_shape) -> decltype(*this)

input shape from an expected input.

auto normalized_shape(std::vector<int64_t> &&new_normalized_shape) -> decltype(*this)
const std::vector<int64_t> &normalized_shape() const noexcept
std::vector<int64_t> &normalized_shape() noexcept
auto weight(const Tensor &new_weight) -> decltype(*this)
auto weight(Tensor &&new_weight) -> decltype(*this)
const Tensor &weight() const noexcept
Tensor &weight() noexcept
auto bias(const Tensor &new_bias) -> decltype(*this)
auto bias(Tensor &&new_bias) -> decltype(*this)
const Tensor &bias() const noexcept
Tensor &bias() noexcept
auto eps(const double &new_eps) -> decltype(*this)

a value added to the denominator for numerical stability. Default: 1e-5.

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