docstr: Test for converting GraphData numpy arrays to torch tensors
docstr_tok: ["Test","for","converting","GraphData","numpy","arrays","to","torch","tensors"]
code: def test_graphdata_numpy_to_torch(self):
      """
      Test for converting GraphData numpy arrays to torch tensors
      """
      import torch
  
      num_nodes, num_node_features = 5, 32
      num_edges, num_edge_features = 6, 32
      node_features = np.random.random_sample(
          (num_nodes, num_node_features)
      )
      edge_features = np.random.random_sample(
          (num_edges, num_edge_features)
      )
      edge_index = np.array(
          [
              [0, 1, 2, 2, 3, 4],
              [1, 2, 0, 3, 4, 0],
          ]
      )
      node_pos_features = None
      # z is kwargs
      z = np.random.random(5)
  
      graph_np = GraphData(
          node_features=node_features,
          edge_index=edge_index,
          edge_features=edge_features,
          node_pos_features=node_pos_features,
          z=z,
      )
      graph = graph_np.numpy_to_torch()
  
      assert isinstance(graph.node_features, torch.Tensor)
      assert isinstance(graph.edge_index, torch.Tensor)
      assert isinstance(graph.edge_features, torch.Tensor)
      assert graph.node_pos_features is None
      assert isinstance(graph.z, torch.Tensor)
  
file_path: deepchem/deepchem/feat/tests/test_graph_data.py
imports: import unittest
  import numpy
  import pytest
  from deepchem.feat.graph_data import BatchGraphData, GraphData, shortest_path_length
label_desc: Use image node_id 5 for calling the TestGraph obj's underlying member method code with example usage: obj.test_graphdata_numpy_to_torch() without return types