def get_current_visuals(self, need_HR=True):
out_dict = OrderedDict()
#out_dict[‘LR’] = self.var_L.detach()[0].float().cpu()
out_dict[‘SR’] = self.SR.detach()[0].float().cpu()
#out_dict[‘LR_est’] = self.LR_est.detach()[0].float().cpu()
if need_HR:
out_dict[‘HR’] = self.var_H.detach()[0].float().cpu()
#out_dict[‘DR’] = self.DR.detach()[0].float().cpu()
#out_dict[‘HR_Est’] = self.HR_est.detach()[0].float().cpu()
return out_dict
This is my code for storing data from validation. I used detach here also.