class_docstr: Unit tests for ReplayMemory.
class_docstr_tok: ["Unit","tests","for","ReplayMemory","."]
code: def test_uniform_sampling(self):
      sut = ReplayMemory(3)
      self.assertEqual(sut.sample_minibatch(1), [])
  
      sut.store(1, "ignore", "ignore", "ignore", 0)
      self.assertEqual(sut.size(), 1)
      self.assertEqual([s[0] for s in sut.sample_minibatch(1)], [0])
      self.assertEqual([s[0] for s in sut.sample_minibatch(2)], [0])
  
      sut.store(2, "ignore", "ignore", "ignore", 0)
      sut.store(3, "ignore", "ignore", "ignore", 0)
      self.assertEqual(sut.size(), 3)
      samples = sut.sample_minibatch(1)
      self.assertEqual(len(samples), 1)
      self.assertTrue(set(s[0] for s in samples).issubset([0, 1, 2]))
      self.assertTrue(
          set(s[1].state for s in samples).issubset([1, 2, 3])
      )
  
      sut.store(4, "ignore", "ignore", "ignore", 0)
      self.assertEqual(sut.size(), 3)
      samples = sut.sample_minibatch(1)
      self.assertEqual(len(samples), 1)
      self.assertTrue(set(s[0] for s in samples).issubset([0, 1, 2]))
      self.assertTrue(
          set(s[1].state for s in samples).issubset([2, 3, 4])
      )
  
imports: import unittest
  from cntk.contrib.deeprl.agent.shared.replay_memory import ReplayMemory
label_desc: Use image node_id 1 for calling the ReplayMemoryTest obj's underlying member method code with example usage: obj.test_uniform_sampling() without return types