Rate this Page

Program Listing for File instancenorm.h#

Return to documentation for file (torch/csrc/api/include/torch/nn/options/instancenorm.h)

#pragma once

#include <torch/arg.h>
#include <torch/csrc/Export.h>
#include <torch/nn/options/batchnorm.h>
#include <torch/types.h>

namespace torch::nn {

struct TORCH_API InstanceNormOptions {
  /* implicit */ InstanceNormOptions(int64_t num_features);

  TORCH_ARG(int64_t, num_features);

  TORCH_ARG(double, eps) = 1e-5;

  TORCH_ARG(double, momentum) = 0.1;

  TORCH_ARG(bool, affine) = false;

  TORCH_ARG(bool, track_running_stats) = false;
};

using InstanceNorm1dOptions = InstanceNormOptions;

using InstanceNorm2dOptions = InstanceNormOptions;

using InstanceNorm3dOptions = InstanceNormOptions;

namespace functional {

struct TORCH_API InstanceNormFuncOptions {
  TORCH_ARG(Tensor, running_mean) = Tensor();

  TORCH_ARG(Tensor, running_var) = Tensor();

  TORCH_ARG(Tensor, weight) = Tensor();

  TORCH_ARG(Tensor, bias) = Tensor();

  TORCH_ARG(bool, use_input_stats) = true;

  TORCH_ARG(double, momentum) = 0.1;

  TORCH_ARG(double, eps) = 1e-5;
};

} // namespace functional

} // namespace torch::nn