def write_policy_model_file(epoch): with gfile.GFile( ppo.get_policy_model_file_from_epoch(output_dir, epoch), "w") as f: f.write("some data")
def test_get_policy_model_file_from_epoch(self): self.assertEqual("/tmp/model-000000.pkl", ppo.get_policy_model_file_from_epoch("/tmp", 0)) self.assertEqual("/tmp/model-123456.pkl", ppo.get_policy_model_file_from_epoch("/tmp", 123456))
def write_policy_model_file(epoch): fname = ppo.get_policy_model_file_from_epoch(output_dir, epoch) with gfile.GFile(fname, "w") as f: f.write("some data") return fname