def METHOD_NAME(self):
    def _construct_model_with_shared_parameters(path, value):
        m = ModelWithSharedParameter()
        nn.init.constant_(m.FC1.weight, value)
        torch.save({"model": m.state_dict()}, path)
        return m
    tmpdir = tempfile.mkdtemp()
    paths = []
    path = os.path.join(tmpdir, "m1.pt")
    m1 = _construct_model_with_shared_parameters(path, 1.0)
    paths.append(path)
    path = os.path.join(tmpdir, "m2.pt")
    m2 = _construct_model_with_shared_parameters(path, 2.0)
    paths.append(path)
    path = os.path.join(tmpdir, "m3.pt")
    m3 = _construct_model_with_shared_parameters(path, 3.0)
    paths.append(path)
    new_model = average_checkpoints(paths)
    self.assertTrue(
        torch.equal(
            new_model["model"]["embedding.weight"],
            (m1.embedding.weight + m2.embedding.weight + m3.embedding.weight) / 3.0,
        )
    )
    self.assertTrue(
        torch.equal(
            new_model["model"]["FC1.weight"],
            (m1.FC1.weight + m2.FC1.weight + m3.FC1.weight) / 3.0,
        )
    )
    self.assertTrue(
        torch.equal(
            new_model["model"]["FC2.weight"],
            (m1.FC2.weight + m2.FC2.weight + m3.FC2.weight) / 3.0,
        )
    )
    shutil.rmtree(tmpdir)