code: def _torch_tensor_from_cp_array(ar):
      if len(ar) == 0:
          return torch.as_tensor(ar.get()).to("cuda")
      return torch.as_tensor(ar, device="cuda")
  
imports: from __future__ import annotations
  from typing import Optional, Sequence, Tuple, Dict, Union
  from functools import cached_property
  from cugraph.utilities.utils import import_optional, MissingModule
  from cugraph.gnn import FeatureStore
  from cugraph.gnn.dgl_extensions.dgl_uniform_sampler import DGLUniformSampler
  import cudf
  import dask_cudf
  import cupy
  from cugraph_dgl.utils.cugraph_storage_utils import _assert_valid_canonical_etype, backend_dtype_to_np_dtype_dict, add_edge_ids_to_edges_dict, add_node_offset_to_edges_dict
  from cugraph_dgl.utils.feature_storage import dgl_FeatureStorage
label_desc: Use image node_id 1 for calling a global function with example usage: _torch_tensor_from_cp_array(ar) and returns: torch, torch