def METHOD_NAME(model1, model2):
    model1_params, model1_buffers = dict(model1.named_parameters()), dict(model1.named_buffers())
    model2_params, model2_buffers = dict(model2.named_parameters()), dict(model2.named_buffers())
    for name in model1_params.keys():
        torch.testing.assert_close(model1_params[name].data, model2_params[name].data)
    for name in model1_buffers.keys():
        torch.testing.assert_close(model1_buffers[name].data, model2_buffers[name].data)