def METHOD_NAME(self):
    def fn(a, tmp):
        if hasattr(tmp, "somekey"):
            a = a + 1
        if tmp.return_dict:
            return a + torch.ones(2) * tmp.max_length
        return a
    x = torch.randn(2)
    tmp = PretrainedConfig(return_dict=True, max_length=20)
    ref = fn(x, tmp)
    opt_fn = torch._dynamo.optimize("eager", nopython=True)(fn)
    res = opt_fn(x, tmp)
    self.assertTrue(same(ref, res))