ff68a9ef501e7286501dba1719024dfaaab4b473,tests/test_train.py,TestLoadCheckpoint,test_load_full_checkpoint,#TestLoadCheckpoint#,49

Before Change


    def test_load_full_checkpoint(self):
        with contextlib.redirect_stdout(StringIO()):
            trainer = mock_trainer(2, 300, True)
            loader = mock_loader(150)
            epoch, ds = train.load_checkpoint(MagicMock(), trainer, loader)
            self.assertEqual(epoch, 3)
            self.assertEqual(next(iter(ds)), 0)

    def test_load_no_checkpoint(self):

After Change


            itr = epoch_itr.next_epoch_itr(shuffle=False)

            self.assertEqual(epoch_itr.epoch, 3)
            self.assertEqual(epoch_itr.iterations_in_epoch, 0)
            self.assertEqual(next(itr)["net_input"]["src_tokens"][0].item(), 0)

    def test_load_no_checkpoint(self):
        with contextlib.redirect_stdout(StringIO()):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 6

Non-data size: 4

Instances


Project Name: elbayadm/attn2d
Commit Name: ff68a9ef501e7286501dba1719024dfaaab4b473
Time: 2018-06-15
Author: myleott@fb.com
File Name: tests/test_train.py
Class Name: TestLoadCheckpoint
Method Name: test_load_full_checkpoint


Project Name: pytorch/fairseq
Commit Name: ff68a9ef501e7286501dba1719024dfaaab4b473
Time: 2018-06-15
Author: myleott@fb.com
File Name: tests/test_train.py
Class Name: TestLoadCheckpoint
Method Name: test_load_no_checkpoint


Project Name: elbayadm/attn2d
Commit Name: ff68a9ef501e7286501dba1719024dfaaab4b473
Time: 2018-06-15
Author: myleott@fb.com
File Name: tests/test_train.py
Class Name: TestLoadCheckpoint
Method Name: test_load_partial_checkpoint