code: def test_dataset_to(self):
      ds = random_text_classification_dataset(10)
      self.assertTrue(
          np.all(
              [
                  item[
                      PytorchTextClassificationDataset.INDEX_TEXT
                  ].device
                  == torch.device("cpu")
                  for item in ds.data
              ]
          )
      )
  
      ds = ds.to("cuda")
      self.assertTrue(
          np.all(
              [
                  item[
                      PytorchTextClassificationDataset.INDEX_TEXT
                  ].device.type
                  == "cuda"
                  for item in ds.data
              ]
          )
      )
  
file_path: small-text/tests/integration/small_text/integrations/pytorch/test_datasets.py
imports: import unittest
  import pytest
  import numpy
  from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
label_desc: Use image node_id 1 for calling the PytorchTextClassificationDatasetTest obj's underlying member method code with example usage: obj.test_dataset_to() without return types