class_docstr: Base class for `neural (or range) augmentation <https://arxiv.org/abs/2212.10553>`_
class_docstr_tok: ["Base","class","for","`","neural","(","or","range",")","augmentation","<","https",":","\/\/arxiv.org\/abs\/2212.10553",">","`","_"]
code: def _apply_noise(self, x: Tensor, *args, **kwargs) -> Tensor:
      # self._check_noise_bounds()
      x_shape = [*x.shape]
      x_shape[1:] = [1] * (len(x_shape) - 1)
  
      if isinstance(self.noise, nn.Parameter):
          # learning a fixed number of parameters
          variance = self.noise
      elif isinstance(self.noise, _distribution_tuple):
          # learning a distribution range from which parameter is sampled.
          variance = self.noise(
              x_shape, device=x.device, data_type=x.dtype
          )
      else:
          raise NotImplementedError
      return random_noise(x, variance, *args, *kwargs)
  
imports: import argparse
  import random
  from typing import List, Optional
  import torch
  from torch import Tensor, nn
  from cvnets.misc.common import parameter_list
  from cvnets.neural_augmentor.utils.neural_aug_utils import Clip, FixedSampler, UniformSampler, random_brightness, random_contrast, random_noise
  from utils import logger
label_desc: Use image node_id 9 for calling the BaseNeuralAugmentor obj's underlying member method code with example usage: obj._apply_noise(x) and returns: random_noise