class_docstr: Randomly adjust the contrast of input images by calculating a randomized smooth field for each invocation.
  
  This uses SmoothField internally to define the adjustment over the image. If `pad` is greater than 0 the
  edges of the input volume of that width will be mostly unchanged. Contrast is changed by raising input
  values by the power of the smooth field so the range of values given by `gamma` should be chosen with this
  in mind. For example, a minimum value of 0 in `gamma` will produce white areas so this should be avoided.
  After the contrast is adjusted the values of the result are rescaled to the range of the original input.
  
  Args:
      spatial_size: size of input array's spatial dimensions
      rand_size: size of the randomized field to start from
      pad: number of pixels/voxels along the edges of the field to pad with 1
      mode: interpolation mode to use when upsampling
      align_corners: if True align the corners when upsampling field
      prob: probability transform is applied
      gamma: (min, max) range for exponential field
      device: Pytorch device to define field on
class_docstr_tok: ["Randomly","adjust","the","contrast","of","input","images","by","calculating","a","randomized","smooth","field","for","each","invocation",".","This","uses","SmoothField","internally","to","define","the","adjustment","over","the","image",".","If","`","pad","`","is","greater","than","0","the","edges","of","the","input","volume","of","that","width","will","be","mostly","unchanged",".","Contrast","is","changed","by","raising","input","values","by","the","power","of","the","smooth","field","so","the","range","of","values","given","by","`","gamma","`","should","be","chosen","with","this","in","mind",".","For","example",",","a","minimum","value","of","0","in","`","gamma","`","will","produce","white","areas","so","this","should","be","avoided",".","After","the","contrast","is","adjusted","the","values","of","the","result","are","rescaled","to","the","range","of","the","original","input",".","Args",":","spatial_size",":","size","of","input","array","'s","spatial","dimensions","rand_size",":","size","of","the","randomized","field","to","start","from","pad",":","number","of","pixels\/voxels","along","the","edges","of","the","field","to","pad","with","1","mode",":","interpolation","mode","to","use","when","upsampling","align_corners",":","if","True","align","the","corners","when","upsampling","field","prob",":","probability","transform","is","applied","gamma",":","(","min",",","max",")","range","for","exponential","field","device",":","Pytorch","device","to","define","field","on"]
code: def set_mode(self, mode: str) -> None:
      self.sfield.set_mode(mode)
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from typing import Any
  import numpy
  import torch
  from torch.nn.functional import grid_sample, interpolate
  from monai.config.type_definitions import NdarrayOrTensor
  from monai.data.meta_obj import get_track_meta
  from monai.networks.utils import meshgrid_ij
  from monai.transforms.transform import Randomizable, RandomizableTransform
  from monai.transforms.utils_pytorch_numpy_unification import moveaxis
  from monai.utils import GridSampleMode, GridSamplePadMode, InterpolateMode
  from monai.utils.enums import TransformBackends
  from monai.utils.module import look_up_option
  from monai.utils.type_conversion import convert_to_dst_type, convert_to_tensor
label_desc: Use image node_id 4 for calling the RandSmoothFieldAdjustContrast obj's underlying member method code with example usage: obj.set_mode(mode) without return types