class_docstr: Remap byte values in [0, 255] to new values in [0, 255] using a permutation.
class_docstr_tok: ["Remap","byte","values","in","[","0",",","255","]","to","new","values","in","[","0",",","255","]","using","a","permutation","."]
docstr: Remap byte values in [0, 255] to new values in [0, 255] using a permutation.
  
  Args:
      data: A dictionary containing a key called "samples", which contains
          a tensor of shape [N], where N is the number of bytes.
  
  Returns:
      The transformed data.
docstr_tok: ["Remap","byte","values","in","[","0",",","255","]","to","new","values","in","[","0",",","255","]","using","a","permutation",".","Args",":","data",":","A","dictionary","containing","a","key","called","``","samples","''",",","which","contains","a","tensor","of","shape","[","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]]:
      """
      Remap byte values in [0, 255] to new values in [0, 255] using a permutation.
  
      Args:
          data: A dictionary containing a key called "samples", which contains
              a tensor of shape [N], where N is the number of bytes.
  
      Returns:
          The transformed data.
      """
      x = data["samples"]
  
      if x.dim() != 1:
          raise ValueError(f"Expected 1d tensor. Got {x.shape}.")
      x = torch.index_select(self.mask, dim=0, index=x)
      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 BytePermutation obj's underlying member method code with example usage: obj.__call__(data) and returns: data