:github_url: https://github.com/pytorch/pytorch .. _program_listing_file_torch_csrc_api_include_torch_nn_options_normalization.h: Program Listing for File normalization.h ======================================== |exhale_lsh| :ref:`Return to documentation for file ` (``torch/csrc/api/include/torch/nn/options/normalization.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include namespace torch::nn { struct TORCH_API LayerNormOptions { /* implicit */ LayerNormOptions(std::vector normalized_shape); TORCH_ARG(std::vector, normalized_shape); TORCH_ARG(double, eps) = 1e-5; TORCH_ARG(bool, elementwise_affine) = true; }; // ============================================================================ namespace functional { struct TORCH_API LayerNormFuncOptions { /* implicit */ LayerNormFuncOptions(std::vector normalized_shape); TORCH_ARG(std::vector, normalized_shape); TORCH_ARG(Tensor, weight); TORCH_ARG(Tensor, bias); TORCH_ARG(double, eps) = 1e-5; }; } // namespace functional // ============================================================================ struct TORCH_API LocalResponseNormOptions { /* implicit */ LocalResponseNormOptions(int64_t size) : size_(size) {} TORCH_ARG(int64_t, size); TORCH_ARG(double, alpha) = 1e-4; TORCH_ARG(double, beta) = 0.75; TORCH_ARG(double, k) = 1.; }; namespace functional { using LocalResponseNormFuncOptions = LocalResponseNormOptions; } // namespace functional // ============================================================================ struct TORCH_API CrossMapLRN2dOptions { CrossMapLRN2dOptions(int64_t size); TORCH_ARG(int64_t, size); TORCH_ARG(double, alpha) = 1e-4; TORCH_ARG(double, beta) = 0.75; TORCH_ARG(int64_t, k) = 1; }; // ============================================================================ namespace functional { struct TORCH_API NormalizeFuncOptions { TORCH_ARG(double, p) = 2.0; TORCH_ARG(int64_t, dim) = 1; TORCH_ARG(double, eps) = 1e-12; TORCH_ARG(std::optional, out) = std::nullopt; }; } // namespace functional // ============================================================================ struct TORCH_API GroupNormOptions { /* implicit */ GroupNormOptions(int64_t num_groups, int64_t num_channels); TORCH_ARG(int64_t, num_groups); TORCH_ARG(int64_t, num_channels); TORCH_ARG(double, eps) = 1e-5; TORCH_ARG(bool, affine) = true; }; // ============================================================================ namespace functional { struct TORCH_API GroupNormFuncOptions { /* implicit */ GroupNormFuncOptions(int64_t num_groups); TORCH_ARG(int64_t, num_groups); TORCH_ARG(Tensor, weight); TORCH_ARG(Tensor, bias); TORCH_ARG(double, eps) = 1e-5; }; } // namespace functional } // namespace torch::nn