code: def test_tsdataset_to_torch_loader(self):
      df = get_ts_df()
      horizon = random.randint(1, 10)
      lookback = random.randint(1, 20)
      batch_size = random.randint(16, 32)
  
      tsdata = TSDataset.from_pandas(
          df,
          dt_col="datetime",
          target_col="value",
          extra_feature_col=["extra feature"],
          id_col="id",
      )
  
      with pytest.raises(RuntimeError):
          tsdata.to_torch_data_loader()
  
      tsdata.roll(lookback=lookback, horizon=horizon)
      loader = tsdata.to_torch_data_loader(
          batch_size=batch_size, lookback=lookback, horizon=horizon
      )
      for x_batch, y_batch in loader:
          assert tuple(x_batch.size()) == (batch_size, lookback, 2)
          assert tuple(y_batch.size()) == (batch_size, horizon, 1)
          break
  
imports: import pytest
  import numpy
  import pandas
  import random
  import tempfile
  import os
  import shutil
  from test.zoo.pipeline.utils.test_utils import ZooTestCase
  from zoo.chronos.data import TSDataset
  from pandas.testing import assert_frame_equal
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 11 for calling the TestTSDataset obj's underlying member method code with example usage: obj.test_tsdataset_to_torch_loader() without return types