code: def test_my_collate_fn(self):
      ds = DataSet(
          {
              "x": [[1, 2], [2, 3, 4], [4, 5, 6, 7]] * 10,
              "y": [1, 0, 1] * 10,
          }
      )
  
      def collate_fn(batch):
          res = {"x": [], "y": []}
          for ins in batch:
              res["x"].append(ins["x"])
              res["y"].append(ins["y"])
          return res
  
      fdl = TorchDataLoader(
          ds, collate_fn=collate_fn, batch_size=3, drop_last=True
      )
      for batch in fdl:
          assert batch["x"] == [[1, 2], [2, 3, 4], [4, 5, 6, 7]]
          assert batch["y"] == [1, 0, 1]
  
file_path: fastNLP/tests/core/dataloaders/torch_dataloader/test_fdl.py
imports: import pytest
  from fastNLP.core.dataloaders.torch_dataloader import TorchDataLoader, prepare_torch_dataloader
  from fastNLP.core.dataset import DataSet
  from fastNLP.io.data_bundle import DataBundle
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH
  from pkg_resources import parse_version
  from tests.helpers.utils import Capturing, recover_logger
  from fastNLP import logger
  import numpy
label_desc: Use image node_id 6 for calling the TestFdl obj's underlying member method code with example usage: obj.test_my_collate_fn() and returns: res