Struct NormalizeFuncOptions

Page Contents

Struct Documentation

struct torch::nn::functional::NormalizeFuncOptions

Options for torch::nn::functional::normalize.


namespace F = torch::nn::functional;
F::normalize(input, F::NormalizeFuncOptions().p(1).dim(-1));

Public Functions

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

The exponent value in the norm formulation. Default: 2.0.

auto p(double &&new_p) -> decltype(*this)
const double &p() const noexcept
double &p() noexcept
auto dim(const int64_t &new_dim) -> decltype(*this)

The dimension to reduce. Default: 1.

auto dim(int64_t &&new_dim) -> decltype(*this)
const int64_t &dim() const noexcept
int64_t &dim() noexcept
auto eps(const double &new_eps) -> decltype(*this)

Small value to avoid division by zero. Default: 1e-12.

auto eps(double &&new_eps) -> decltype(*this)
const double &eps() const noexcept
double &eps() noexcept
auto out(const c10::optional<Tensor> &new_out) -> decltype(*this)

the output tensor.

If out is used, this operation won’t be differentiable.

auto out(c10::optional<Tensor> &&new_out) -> decltype(*this)
const c10::optional<Tensor> &out() const noexcept
c10::optional<Tensor> &out() noexcept


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources