code: def get_model_device(model):
      assert isinstance(model, nn.Module)
  
      parameters = list(model.parameters())
      if len(parameters) == 0:
          return None
      else:
          return parameters[0].device
  
file_path: DeepKE/src/deepke/name_entity_re/few_shot/utils/util.py
imports: import torch
  import numpy
  import random
  from torch import nn
  import torch.nn.functional
  from transformers import BartModel, BartTokenizer, BertTokenizer
  import os
label_desc: Use image node_id 4 for calling a global function with example usage: get_model_device(model) and returns: None, parameters