Add comment to explain is_distillable

This commit is contained in:
Daniël de Kok 2023-01-13 16:28:37 +01:00
parent 985dd2236c
commit c7869750ee

View File

@ -267,6 +267,10 @@ cdef class TrainablePipe(Pipe):
@property @property
def is_distillable(self) -> bool: def is_distillable(self) -> bool:
# Normally a pipe overrides `get_teacher_student_loss` to implement
# distillation. In more exceptional cases, a pipe can provide its
# own `distill` implementation. If neither of these methods is
# overridden, the pipe does not implement distillation.
return not (self.__class__.distill is TrainablePipe.distill and self.__class__.get_teacher_student_loss is TrainablePipe.get_teacher_student_loss) return not (self.__class__.distill is TrainablePipe.distill and self.__class__.get_teacher_student_loss is TrainablePipe.get_teacher_student_loss)
@property @property