Freezing only part of the model

I want to change the following

(RNN-T from mlcommons benchmark)

to use the new torch.jit.freeze API, but it throws errors.
Can this be done?