docstr: Get magnitude based on sampling type.
docstr_tok: ["Get","magnitude","based","on","sampling","type","."]
code: def _get_magnitude(self) -> float:
      """
      Get magnitude based on sampling type.
      """
      if self.sampling_type == "gaussian":
          return max(
              0,
              min(
                  self.max_level,
                  torch.normal(
                      self.magnitude,
                      self.sampling_hparas["sampling_std"],
                      size=(1,),
                  ).item(),
              ),
          )
      elif self.sampling_type == "uniform":
          if self.sampling_hparas["sampling_data_type"] == "int":
              return torch.randint(
                  self.sampling_hparas["sampling_min"],
                  self.magnitude + 1,
                  size=(1,),
              ).item()
          elif self.sampling_hparas["sampling_data_type"] == "float":
              return (
                  torch.rand(size=(1,)).item()
                  * (
                      self.magnitude
                      - self.sampling_hparas["sampling_min"]
                  )
                  + self.sampling_hparas["sampling_min"]
              )
          else:
              raise ValueError(
                  "sampling_data_type must be either 'int' or 'float'"
              )
      else:
          raise NotImplementedError
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import torch
  import torchvision
  from torch import Tensor
  from torchvision.transforms.functional import InterpolationMode
label_desc: Use image node_id 2 for calling the AugmentTransform obj's underlying member method code with example usage: obj._get_magnitude() and returns: max, torch, unknown