code: def to_device(m, x):
      """Send tensor into the device of the module.
  
      Args:
          m (torch.nn.Module): Torch module.
          x (Tensor): Torch tensor.
  
      Returns:
          Tensor: Torch tensor located in the same place as torch module.
  
      """
      if isinstance(m, torch.nn.Module):
          device = next(m.parameters()).device
      elif isinstance(m, torch.Tensor):
          device = m.device
      else:
          raise TypeError(
              "Expected torch.nn.Module or torch.tensor, "
              f"bot got: {type(m)}"
          )
      return x.to(device)
  
file_path: espnet/espnet/nets/pytorch_backend/nets_utils.py
imports: import logging
  from typing import Dict
  import numpy
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: to_device(m, x) and returns: x