code: def check_device(data, device):
      """Check if data is on the target device.
  
      Parameters
      ----------
      data : Tensor or dict[str, Tensor]
      device: Backend device.
  
      Returns
      -------
      Bool: True if the data is on the target device.
      """
      if isinstance(data, dict):
          for v in data.values():
              if v.device != device:
                  return False
      elif data.device != device:
          return False
      return True
  
file_path: dgl/python/dgl/utils/checks.py
imports: from __future__ import absolute_import, division
  from collections.abc import Mapping
  from ..None import backend
  from .._ffi.function import _init_api
  from ..base import DGLError
label_desc: Use image node_id 6 for calling a global function with example usage: check_device(data, device) and returns: True, False, False