I’m trying this:
def freeze_encoding(self, do_freeze=True):
    for weight in self.model.parameters():
        weight.requires_grad = not do_freeze

    if do_freeze: print('freeze encoding')
    pass

I think it would operate on the whole model and the gru I’m interested in is part of that.