code: def test_convert_batch_to_sample_list(self):
      # Test list conversion
      batch = [
          {"a": torch.tensor([1.0, 1.0])},
          {"a": torch.tensor([2.0, 2.0])},
      ]
      sample_list = convert_batch_to_sample_list(batch)
      expected_a = torch.tensor([[1.0, 1.0], [2.0, 2.0]])
      self.assertTrue(torch.equal(expected_a, sample_list.a))
  
      # Test single element list, samplelist
      sample_list = SampleList()
      sample_list.add_field("a", expected_a)
      parsed_sample_list = convert_batch_to_sample_list([sample_list])
      self.assertTrue(isinstance(parsed_sample_list, SampleList))
      self.assertTrue("a" in parsed_sample_list)
      self.assertTrue(torch.equal(expected_a, parsed_sample_list.a))
  
      # Test no tensor field
      batch = [{"a": [1]}, {"a": [2]}]
      sample_list = convert_batch_to_sample_list(batch)
      self.assertTrue(sample_list.a, [[1], [2]])
  
file_path: mmf/tests/common/test_sample.py
imports: import unittest
  import tests.test_utils
  import torch
  from mmf.common.sample import convert_batch_to_sample_list, Sample, SampleList, to_device
label_desc: Use image node_id 2 for calling the TestFunctions obj's underlying member method code with example usage: obj.test_convert_batch_to_sample_list() without return types