code: def _to_tensor(x):
      if not isinstance(x, torch.Tensor):
          return torch.tensor(
              x, dtype=torch.float, device=device
          )  # pylint: disable=E1101
      return x
  
imports: import copy
  import torch
  import warnings
  import numpy
  import pandas
  from qlib.data.dataset import DatasetH
label_desc: Use image node_id 1 for calling a global function with example usage: _to_tensor(x) and returns: x, torch