code: def _prepare_batch(
      batch: Dict, device=None, non_blocking: bool = False
  ):
      """Prepare batch for training: pass to a device with options."""
      result = {
          key: convert_tensor(
              value, device=device, non_blocking=non_blocking
          )
          for key, value in batch.items()
      }
      return result
  
file_path: transfer-nlp/transfer_nlp/plugins/predictors.py
imports: import inspect
  import logging
  from itertools import zip_longest
  from typing import Dict, List, Any
  import torch
  from ignite.utils import convert_tensor
  from transfer_nlp.loaders.vectorizers import Vectorizer
label_desc: Use image node_id 1 for calling a global function with example usage: _prepare_batch(batch, device, non_blocking) and returns: result