original_docstring: 
      A simple batch collator for most common reid tasks
      
docstring: A simple batch collator for most common reid tasks
docstring_tokens: A simple batch collator for most common reid tasks
code: def fast_batch_collator(batched_inputs):
      """
      A simple batch collator for most common reid tasks
      """
  
      elem = batched_inputs[0]
      if isinstance(elem, torch.Tensor):
          out = torch.zeros((len(batched_inputs), *elem.size()), dtype=elem.dtype)
          for i, tensor in enumerate(batched_inputs):
              out[i] += tensor
          return out
  
      elif isinstance(elem, container_abcs.Mapping):
          return {key: fast_batch_collator([d[key] for d in batched_inputs]) for key in elem}
  
      elif isinstance(elem, float):
          return torch.tensor(batched_inputs, dtype=torch.float64)
      elif isinstance(elem, int_classes):
          return torch.tensor(batched_inputs)
      elif isinstance(elem, string_classes):
          return batched_inputs
code_tokens: def fast_batch_collator ( batched_inputs ) : elem = batched_inputs [ 0 ] if isinstance ( elem , torch . Tensor ) : out = torch . zeros ( ( len ( batched_inputs ) , * elem . size ( ) ) , dtype = elem . dtype ) for i , tensor in enumerate ( batched_inputs ) : out [ i ] += tensor return out elif isinstance ( elem , container_abcs . Mapping ) : return { key : fast_batch_collator ( [ d [ key ] for d in batched_inputs ] ) for key in elem } elif isinstance ( elem , float ) : return torch . tensor ( batched_inputs , dtype = torch . float64 ) elif isinstance ( elem , int_classes ) : return torch . tensor ( batched_inputs ) elif isinstance ( elem , string_classes ) : return batched_inputs
short_docstring: A simple batch collator for most common reid tasks
short_docstring_tokens: A simple batch collator for most common reid tasks
comment: """
      A simple batch collator for most common reid tasks
      """