class_docstr: Deform an image using a random smooth field and Pytorch's grid_sample.
  
  The amount of deformation is given by `def_range` in fractions of the size of the image. The size of each dimension
  of the input image is always defined as 2 regardless of actual image voxel dimensions, that is the coordinates in
  every dimension range from -1 to 1. A value of 0.1 means pixels/voxels can be moved by up to 5% of the image's size.
  
  Args:
      spatial_size: input array size to which deformation grid is interpolated
      rand_size: size of the randomized field to start from
      pad: number of pixels/voxels along the edges of the field to pad with 0
      field_mode: interpolation mode to use when upsampling the deformation field
      align_corners: if True align the corners when upsampling field
      prob: probability transform is applied
      def_range: value of the deformation range in image size fractions, single min/max value  or min/max pair
      grid_dtype: type for the deformation grid calculated from the field
      grid_mode: interpolation mode used for sampling input using deformation grid
      grid_padding_mode: padding mode used for sampling input using deformation grid
      grid_align_corners: if True align the corners when sampling the deformation grid
      device: Pytorch device to define field on
class_docstr_tok: ["Deform","an","image","using","a","random","smooth","field","and","Pytorch","'s","grid_sample",".","The","amount","of","deformation","is","given","by","`","def_range","`","in","fractions","of","the","size","of","the","image",".","The","size","of","each","dimension","of","the","input","image","is","always","defined","as","2","regardless","of","actual","image","voxel","dimensions",",","that","is","the","coordinates","in","every","dimension","range","from","-1","to","1",".","A","value","of","0.1","means","pixels\/voxels","can","be","moved","by","up","to","5","%","of","the","image","'s","size",".","Args",":","spatial_size",":","input","array","size","to","which","deformation","grid","is","interpolated","rand_size",":","size","of","the","randomized","field","to","start","from","pad",":","number","of","pixels\/voxels","along","the","edges","of","the","field","to","pad","with","0","field_mode",":","interpolation","mode","to","use","when","upsampling","the","deformation","field","align_corners",":","if","True","align","the","corners","when","upsampling","field","prob",":","probability","transform","is","applied","def_range",":","value","of","the","deformation","range","in","image","size","fractions",",","single","min\/max","value","or","min\/max","pair","grid_dtype",":","type","for","the","deformation","grid","calculated","from","the","field","grid_mode",":","interpolation","mode","used","for","sampling","input","using","deformation","grid","grid_padding_mode",":","padding","mode","used","for","sampling","input","using","deformation","grid","grid_align_corners",":","if","True","align","the","corners","when","sampling","the","deformation","grid","device",":","Pytorch","device","to","define","field","on"]
code: def set_random_state(
      self,
      seed: int | None = None,
      state: np.random.RandomState | None = None,
  ) -> Randomizable:
      super().set_random_state(seed, state)
      self.sfield.set_random_state(seed, state)
      return self
  
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 2 for calling the RandSmoothDeform obj's underlying member method code with example usage: obj.set_random_state(seed, state) and returns: self