Class GroupNormImpl

Inheritance Relationships

Base Type

Class Documentation

class torch::nn::GroupNormImpl : public torch::nn::Cloneable<GroupNormImpl>

Applies Group Normalization over a mini-batch of inputs as described in the paper Group Normalization_ .

See to learn about the exact behavior of this module.

See the documentation for torch::nn::GroupNormOptions class to learn what constructor arguments are supported for this module.


GroupNorm model(GroupNormOptions(2, 2).eps(2e-5).affine(false));

Public Functions

GroupNormImpl(int64_t num_groups, int64_t num_channels)
GroupNormImpl(const GroupNormOptions &options_)
void reset() override

reset() must perform initialization of all members with reference semantics, most importantly parameters, buffers and submodules.

void reset_parameters()
void pretty_print(std::ostream &stream) const override

Pretty prints the GroupNorm module into the given stream.

Tensor forward(const Tensor &input)

Public Members

GroupNormOptions options

The options with which this module was constructed.

Tensor weight

The learned weight.

Tensor bias

The learned bias.


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