code: def _tensor(data, dtype=None):
      """Float32 is the default dtype for float tensor in DGL
      so let's cast float64 into float32 to avoid dtype mismatch.
      """
      ret = F.tensor(data, dtype)
      if F.dtype(ret) == F.float64:
          ret = F.tensor(ret, dtype=F.float32)
      return ret
  
imports: import ast
  import os
  from typing import Callable, List, Optional
  import numpy
  import pandas
  import pydantic
  import yaml
  from ..None import backend
  from ..base import dgl_warning, DGLError
  from ..convert import heterograph
label_desc: Use image node_id 3 for calling a global function with example usage: _tensor(data, dtype) and returns: ret