Hi,
Yes this is expected. Getting the state_dict is not a differentiable operation. But that shouldn’t be a problem here as you’re not doing it during the forward.
In any case, since the input to your model requires_grad, then all the output will as well (even if the weights don’t).
But if you’re model is just the same as the RouteNet you shared above, then the output will require gradient if the input x does.