Rate this Page

Class GroupNormImpl#

Inheritance Relationships#

Base Type#

Class Documentation#

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

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

See https://pytorch.org/docs/main/nn.html#torch.nn.GroupNorm 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.

Example:

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

Public Functions

inline GroupNormImpl(int64_t num_groups, int64_t num_channels)#
explicit GroupNormImpl(const GroupNormOptions &options_)#
virtual void reset() override#

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

void reset_parameters()#
virtual 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.