docstr: Arguments
  ---------
  value : float or 2-tuple of float
      if single value, both horizontal and vertical translation
      will be this value * total height/width. Thus, value should
      be a fraction of total height/width with range (-1, 1)
  
  interp : string in {'bilinear', 'nearest'} or list of strings
      type of interpolation to use. You can provide a different
      type of interpolation for each input, e.g. if you have two
      inputs then you can say `interp=['bilinear','nearest']
docstr_tok: ["Arguments","--","--","--","--","-","value",":","float","or","2-tuple","of","float","if","single","value",",","both","horizontal","and","vertical","translation","will","be","this","value","*","total","height\/width",".","Thus",",","value","should","be","a","fraction","of","total","height\/width","with","range","(","-1",",","1",")","interp",":","string","in","{","'bilinear","'",",","'nearest","'","}","or","list","of","strings","type","of","interpolation","to","use",".","You","can","provide","a","different","type","of","interpolation","for","each","input",",","e.g",".","if","you","have","two","inputs","then","you","can","say","`","interp=","[","'bilinear","'",",","'nearest","'","]"]
code: def __init__(self, value, interp="bilinear", lazy=False):
      """
      Arguments
      ---------
      value : float or 2-tuple of float
          if single value, both horizontal and vertical translation
          will be this value * total height/width. Thus, value should
          be a fraction of total height/width with range (-1, 1)
  
      interp : string in {'bilinear', 'nearest'} or list of strings
          type of interpolation to use. You can provide a different
          type of interpolation for each input, e.g. if you have two
          inputs then you can say `interp=['bilinear','nearest']
  
      """
      if not isinstance(value, (tuple, list)):
          value = (value, value)
  
      if value[0] > 1 or value[0] < -1:
          raise ValueError("Translation must be between -1 and 1")
      if value[1] > 1 or value[1] < -1:
          raise ValueError("Translation must be between -1 and 1")
  
      self.height_range = value[0]
      self.width_range = value[1]
      self.interp = interp
      self.lazy = lazy
  
imports: import math
  import random
  import torch
  from ..utils import th_affine2d, th_random_choice
label_desc: Use image node_id 1 to create a new Translate object  with example: obj = Translate(value, interp, lazy)