MCPcopy Index your code
hub / github.com/MotrixLab/MotionDiffuse / save

Method save

text2motion/trainers/ddpm_trainer.py:156–167  ·  view source on GitHub ↗
(self, file_name, ep, total_it)

Source from the content-addressed store, hash-verified

154 self.encoder.eval()
155
156 def save(self, file_name, ep, total_it):
157 state = {
158 'opt_encoder': self.opt_encoder.state_dict(),
159 'ep': ep,
160 'total_it': total_it
161 }
162 try:
163 state['encoder'] = self.encoder.module.state_dict()
164 except:
165 state['encoder'] = self.encoder.state_dict()
166 torch.save(state, file_name)
167 return
168
169 def load(self, model_dir):
170 checkpoint = torch.load(model_dir, map_location=self.device)

Callers 8

trainMethod · 0.95
plot_t2mFunction · 0.80
save_imageFunction · 0.80
compose_gif_img_listFunction · 0.80
compose_and_save_imgFunction · 0.80
motion_process.pyFile · 0.80
plot_3d_motionFunction · 0.80
__init__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected