code: def test_multi_node_iterator_compatibility(self):
      iters = (
          lambda: chainermn.iterators.create_multi_node_iterator(
              self.iterator_class(self.dataset, batch_size=self.bs),
              self.communicator,
          ),
          lambda: self.iterator_class(self.dataset, batch_size=self.bs),
      )
  
      bs_n_ratio = 1.0 * self.bs / self.N
  
      it_before, it_after = iters
  
      it = it_before()
  
      self.assertEqual(it.epoch, 0)
      self.assertAlmostEqual(it.epoch_detail, 0 * bs_n_ratio)
      batch1 = it.next()
      self.assertEqual(len(batch1), self.bs)
      self.assertIsInstance(batch1, list)
      self.assertFalse(it.is_new_epoch)
      self.assertAlmostEqual(it.epoch_detail, 1 * bs_n_ratio)
      batch2 = it.next()
      self.assertEqual(len(batch2), self.bs)
      self.assertIsInstance(batch2, list)
      self.assertFalse(it.is_new_epoch)
      self.assertAlmostEqual(it.epoch_detail, 2 * bs_n_ratio)
  
      target = dict()
      it.serialize(DummySerializer(target))
  
      it = it_after()
      it.serialize(DummyDeserializer(target))
      self.assertFalse(it.is_new_epoch)
      self.assertAlmostEqual(it.epoch_detail, 2 * bs_n_ratio)
  
      batch3 = it.next()
      self.assertEqual(len(batch3), self.bs)
      self.assertIsInstance(batch3, list)
      self.assertTrue(it.is_new_epoch)
      self.assertEqual(
          sorted(batch1 + batch2 + batch3), self.dataset.tolist()
      )
      self.assertAlmostEqual(it.epoch_detail, 3 * bs_n_ratio)
  
imports: import numpy
  import platform
  import pytest
  import unittest
  import chainer
  import chainer.testing
  import chainermn
label_desc: Use image node_id 2 for calling the TestIteratorCompatibility obj's underlying member method code with example usage: obj.test_multi_node_iterator_compatibility() without return types