class_docstr: An abstraction of an atomic tensor or a tuple of tensors. This
  eliminates every boilerplate code to classify an atomic tensor or a tuple
  of tensors.
  ::
  
      x = generate_tensor_or_tensors()
      x = Batch(x)
  
      # in-place update
      x[0] = F.apply(x[0])
      x[:] = F.apply(*x)
  
      # f(x) if x is a tensor.
      # f(*x) if x is a tuple of tensors.
      # y is also a batch.
      y = x.call(f)
class_docstr_tok: ["An","abstraction","of","an","atomic","tensor","or","a","tuple","of","tensors",".","This","eliminates","every","boilerplate","code","to","classify","an","atomic","tensor","or","a","tuple","of","tensors",".",":",":","x","=","generate_tensor_or_tensors","(",")","x","=","Batch","(","x",")","#","in-place","update","x","[","0","]","=","F.apply","(","x","[","0","]",")","x","[",":","]","=","F.apply","(","*","x",")","#","f","(","x",")","if","x","is","a","tensor",".","#","f","(","*","x",")","if","x","is","a","tuple","of","tensors",".","#","y","is","also","a","batch",".","y","=","x.call","(","f",")"]
code: def __getitem__(self, index: int) -> Tensor:
      if not self.atomic:
          return self.tensors[index]
  
      if index != 0:
          raise IndexError("atomic batch allows index 0 only")
  
      return self.tensor
  
imports: import typing
  from typing import Callable, Iterable, Iterator, List, Tuple, Union, cast
  import torch
  from torch import Tensor
  import torch.cuda.comm
label_desc: Use image node_id 10 for calling the Batch obj's underlying member method code with example usage: obj.__getitem__(index) and returns: self, self