Skip to content

Commit

Permalink
detach output from teacher
Browse files Browse the repository at this point in the history
  • Loading branch information
twmht committed Mar 2, 2022
1 parent 0dd407a commit c19a8ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmrazor/models/distillers/self_distiller.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def teacher_forward_output_hook(self, module, inputs, outputs):
outputs (tuple): out of module
"""
if self.training and getattr(self, 'is_teacher', None):
self.teacher_outputs[self.module2name[module]].append(outputs)
self.teacher_outputs[self.module2name[module]].append(outputs.detach())

def student_forward_output_hook(self, module, inputs, outputs):
"""Save the output.
Expand Down

0 comments on commit c19a8ec

Please sign in to comment.