class_docstr: Tests ``GraphClassificationData``.
code: def test_transforms(self, tmpdir):
      tudataset = TUDataset(root=tmpdir, name="KKI")
      train_dataset = tudataset
      val_dataset = tudataset
      test_dataset = tudataset
      predict_dataset = tudataset
  
      class TestInputTransform(GraphClassificationInputTransform):
          def per_sample_transform(self):
              return T.Compose(
                  [
                      super().per_sample_transform(),
                      PyGTransformAdapter(
                          OneHotDegree(tudataset.num_features - 1)
                      ),
                  ]
              )
  
      # instantiate the data module
      dm = GraphClassificationData.from_datasets(
          train_dataset=train_dataset,
          val_dataset=val_dataset,
          test_dataset=test_dataset,
          predict_dataset=predict_dataset,
          transform=TestInputTransform,
          batch_size=2,
      )
      assert dm is not None
      assert dm.train_dataloader() is not None
      assert dm.val_dataloader() is not None
      assert dm.test_dataloader() is not None
  
      # check training data
      data = next(iter(dm.train_dataloader()))[DataKeys.INPUT]
      assert list(data.x.size())[1] == tudataset.num_features * 2
      assert list(data.y.size()) == [2]
  
      # check val data
      data = next(iter(dm.val_dataloader()))[DataKeys.INPUT]
      assert list(data.x.size())[1] == tudataset.num_features * 2
      assert list(data.y.size()) == [2]
  
      # check test data
      data = next(iter(dm.test_dataloader()))[DataKeys.INPUT]
      assert list(data.x.size())[1] == tudataset.num_features * 2
      assert list(data.y.size()) == [2]
  
file_path: lightning-flash/tests/graph/classification/test_data.py
imports: import pytest
  from flash import DataKeys
  from flash.core.utilities.imports import _TOPIC_GRAPH_AVAILABLE, _TORCHVISION_AVAILABLE
  from flash.graph.classification.data import GraphClassificationData
  from flash.graph.classification.input_transform import GraphClassificationInputTransform, PyGTransformAdapter
label_desc: Use image node_id 3 for calling the TestGraphClassificationData obj's underlying member method code with example usage: obj.test_transforms(tmpdir) and returns: T