Shortcuts

Template Class NormImplBase

Inheritance Relationships

Base Type

Derived Types

Class Documentation

template<size_t D, typename Derived, typename DerivedOptions>
class NormImplBase : public torch::nn::Cloneable<Derived>

Base class for all (dimension-specialized) batchnorm and instancenorm modules.

Subclassed by torch::nn::BatchNormImplBase< 1, BatchNorm1dImpl >, torch::nn::BatchNormImplBase< 3, BatchNorm3dImpl >, torch::nn::BatchNormImplBase< 2, BatchNorm2dImpl >, torch::nn::InstanceNormImpl< 1, InstanceNorm1dImpl >, torch::nn::InstanceNormImpl< 2, InstanceNorm2dImpl >, torch::nn::InstanceNormImpl< 3, InstanceNorm3dImpl >

Public Functions

inline NormImplBase(const DerivedOptions &options_)
inline virtual void reset() override

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

inline void reset_running_stats()
inline void reset_parameters()

Public Members

DerivedOptions options

The options with which this module was constructed.

Tensor weight

The learned weight.

Only defined if the affine option was true upon construction.

Tensor bias

The learned bias.

Only defined if the affine option was true upon construction.

Tensor running_mean

The running mean.

Only defined if the track_running_stats option was true upon construction.

Tensor running_var

The running variance.

Only defined if the track_running_stats option was true upon construction.

Tensor num_batches_tracked

The number of the forward call.

Only defined if the track_running_stats option was true upon construction.

Protected Functions

virtual void _check_input_dim(const Tensor &input) = 0

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