Pytorch miss call to eval
Checks if eval() is called before validating or testing a model. Some layers behave differently during training and evaluation.
def pytorch_miss_call_to_eval_noncompliant(model):
    import torch
    # Noncompliant: miss call to `eval()` after load.
    model.load_state_dict(torch.load("model.pth"))
def pytorch_miss_call_to_eval_compliant(model):
    model.load_state_dict(torch.load("model.pth"))
    # Compliant: `eval()` is called after load.
    model.eval()