There isn’t a way to check the used shapes during training if the model is able to accept variable input shapes. You could store the input shapes e.g. in the checkpoint along with the state_dict or store it as an attribute in the model code instead.