class_docstr: Add random uniform noise to integer values.
class_docstr_tok: ["Add","random","uniform","noise","to","integer","values","."]
docstr: Add random uniform noise to byte values.
  
  Args:
      data: A dict containing a tensor in its "samples" key. The tensor
          contains integers representing byte values. Integers are used
          because negative padding values may be added later. The shape
          of the tenor is [N], where N is the number of bytes.
  
  Returns:
      The transformed data.
docstr_tok: ["Add","random","uniform","noise","to","byte","values",".","Args",":","data",":","A","dict","containing","a","tensor","in","its","``","samples","''","key",".","The","tensor","contains","integers","representing","byte","values",".","Integers","are","used","because","negative","padding","values","may","be","added","later",".","The","shape","of","the","tenor","is","[","N","]",",","where","N","is","the","number","of","bytes",".","Returns",":","The","transformed","data","."]
code: def __call__(
      self, data: Dict[str, Union[torch.Tensor, int]]
  ) -> Dict[str, Union[torch.Tensor, int]]:
      """
      Add random uniform noise to byte values.
  
      Args:
          data: A dict containing a tensor in its "samples" key. The tensor
              contains integers representing byte values. Integers are used
              because negative padding values may be added later. The shape
              of the tenor is [N], where N is the number of bytes.
  
      Returns:
          The transformed data.
      """
      x = data["samples"]
      noise = torch.randint_like(
          x, self.width_range[0], self.width_range[1] + 1
      )
      dtype = x.dtype
      x = x.int()
      x = x + noise
      x = x % 256
      x = x.to(dtype)
      data["samples"] = x
      return data
  
imports: import argparse
  import io
  from typing import Dict, Union
  import numpy
  import torch
  from PIL import Image
  from data.transforms import TRANSFORMATIONS_REGISTRY, BaseTransformation
label_desc: Use image node_id 2 for calling the RandomUniformNoise obj's underlying member method code with example usage: obj.__call__(data) and returns: data