MCPcopy Index your code
hub / github.com/pytorch/tutorials / save

Method save

intermediate_source/mario_rl_tutorial.py:566–574  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

564
565class Mario(Mario):
566 def save(self):
567 save_path = (
568 self.save_dir / f"mario_net_{int(self.curr_step // self.save_every)}.chkpt"
569 )
570 torch.save(
571 dict(model=self.net.state_dict(), exploration_rate=self.exploration_rate),
572 save_path,
573 )
574 print(f"MarioNet saved to {save_path} at step {self.curr_step}")
575
576
577######################################################################

Calls

no outgoing calls

Tested by

no test coverage detected