code: def _short_str(tensor):
      # unwrap variable to tensor
      if not torch.is_tensor(tensor):
          # (1) unpack variable
          if hasattr(tensor, "data"):
              tensor = tensor.data
          # (2) handle include_lengths
          elif isinstance(tensor, tuple):
              return str(tuple(_short_str(t) for t in tensor))
          # (3) fallback to default str
          else:
              return str(tensor)
  
      # copied from torch _tensor_str
      size_str = "x".join(str(size) for size in tensor.size())
      device_str = (
          ""
          if not tensor.is_cuda
          else " (GPU {})".format(tensor.get_device())
      )
      strt = "[{} of size {}{}]".format(
          torch.typename(tensor), size_str, device_str
      )
      return strt
  
file_path: pytext/pytext/legacy/data/batch.py
imports: import torch
label_desc: Use image node_id 1 for calling a global function with example usage: _short_str(tensor) and returns: strt, str, str