code: def test_torchdataset(ds_params):
      xtype = ds_params
      x = np.random.randn(*shape)
      y = np.random.randn(*(n,))
      if xtype == list:
          x = list(x)
      ds = TorchDataset(x, y)
      for step, data in enumerate(ds):
          pass
      assert data[0].shape == (f,) and data[1].shape == ()
      assert step == len(ds) - 1
  
imports: import numpy
  import pytest
  from alibi_detect.utils.pytorch.data import TorchDataset
label_desc: Use image node_id 2 for calling a global function with example usage: test_torchdataset(ds_params) without return types