code: def batch_to_device(
      batch: Dict[str, torch.Tensor], device: torch.device
  ):
      out = {}
      for k in batch:
          out[k] = batch[k].to(device)
      return out
  
imports: from typing import Dict
  import torch
  import torch.nn
  import torch.nn.functional
  from reagent.core import types
  from reagent.preprocessing.preprocessor import Preprocessor
label_desc: Use image node_id 1 for calling a global function with example usage: batch_to_device(batch, device) and returns: out