code: def get_device(model):
      """
      Convenient function used to get the runtime device for the model.
      """
      assert issubclass(model.__class__, torch.nn.Module)
  
      device = None
      if len(list(model.parameters())) > 0:
          device = next(
              model.parameters()
          ).device  # Assuming we are using a single device for all parameters
  
      return device
  
imports: from packaging.version import Version, parse
  from types import ModuleType
  import numpy
  import torch
  import os
  import warnings
  import shutil
  from hummingbird.ml.exceptions import ConstantError
label_desc: Use image node_id 22 for calling a global function with example usage: get_device(model) and returns: device