docstr: Randomly shear an image with a value sampled from a list of values.
  
  Arguments
  ---------
  values : a list or tuple
      the values from which the rotation value will be sampled
  
  p : a list or tuple the same length as `values`
      the probabilities of sampling any given value. Must sum to 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']
  
  lazy    : boolean
      if false, perform the transform on the tensor and return the tensor
      if true, only create the affine transform matrix and return that
docstr_tok: ["Randomly","shear","an","image","with","a","value","sampled","from","a","list","of","values",".","Arguments","--","--","--","--","-","values",":","a","list","or","tuple","the","values","from","which","the","rotation","value","will","be","sampled","p",":","a","list","or","tuple","the","same","length","as","`","values","`","the","probabilities","of","sampling","any","given","value",".","Must","sum","to","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","'","]","lazy",":","boolean","if","false",",","perform","the","transform","on","the","tensor","and","return","the","tensor","if","true",",","only","create","the","affine","transform","matrix","and","return","that"]
code: def __init__(self, values, p=None, interp="bilinear", lazy=False):
      """
      Randomly shear an image with a value sampled from a list of values.
  
      Arguments
      ---------
      values : a list or tuple
          the values from which the rotation value will be sampled
  
      p : a list or tuple the same length as `values`
          the probabilities of sampling any given value. Must sum to 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']
  
      lazy    : boolean
          if false, perform the transform on the tensor and return the tensor
          if true, only create the affine transform matrix and return that
      """
      if isinstance(values, (list, tuple)):
          values = th.FloatTensor(values)
      self.values = values
      if p is None:
          p = th.ones(len(values)) / len(values)
      else:
          if abs(1.0 - sum(p)) > 1e-3:
              raise ValueError("Probs must sum to 1")
      self.p = p
      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 RandomChoiceShear object  with example: obj = RandomChoiceShear(values, p, interp, lazy)