class_docstr: Test ImageDataset class.
docstr: Test that ImageDataset loads images.
docstr_tok: ["Test","that","ImageDataset","loads","images","."]
code: def test_load_images(self):
      """Test that ImageDataset loads images."""
  
      path = os.path.join(os.path.dirname(__file__), "images")
      files = [os.path.join(path, f) for f in os.listdir(path)]
  
      # First try using images for X.
  
      ds1 = dc.data.ImageDataset(files, np.random.random(10))
      x_shape, y_shape, w_shape, ids_shape = ds1.get_shape()
      np.testing.assert_array_equal([10, 28, 28], x_shape)
      np.testing.assert_array_equal([10], y_shape)
      np.testing.assert_array_equal([10], w_shape)
      np.testing.assert_array_equal([10], ids_shape)
      np.testing.assert_array_equal(ds1.X.shape, x_shape)
      np.testing.assert_array_equal(ds1.y.shape, y_shape)
      np.testing.assert_array_equal(ds1.w.shape, w_shape)
      np.testing.assert_array_equal(ds1.ids.shape, ids_shape)
  
      # Now try using images for y.
  
      ds2 = dc.data.ImageDataset(np.random.random(10), files)
      x_shape, y_shape, w_shape, ids_shape = ds2.get_shape()
      np.testing.assert_array_equal([10], x_shape)
      np.testing.assert_array_equal([10, 28, 28], y_shape)
      np.testing.assert_array_equal([10, 1], w_shape)
      np.testing.assert_array_equal([10], ids_shape)
      np.testing.assert_array_equal(ds2.X.shape, x_shape)
      np.testing.assert_array_equal(ds2.y.shape, y_shape)
      np.testing.assert_array_equal(ds2.w.shape, w_shape)
      np.testing.assert_array_equal(ds2.ids.shape, ids_shape)
      np.testing.assert_array_equal(ds1.X, ds2.y)
  
file_path: deepchem/deepchem/data/tests/test_image_dataset.py
imports: import unittest
  import numpy
  import deepchem
  import os
label_desc: Use image node_id 1 for calling the TestImageDataset obj's underlying member method code with example usage: obj.test_load_images() without return types