diff --git a/torchdrug/data/molecule.py b/torchdrug/data/molecule.py index edf5406..8374da5 100644 --- a/torchdrug/data/molecule.py +++ b/torchdrug/data/molecule.py @@ -518,7 +518,7 @@ def is_valid(self): """A coarse implementation of valence check.""" # TODO: cross-check by any domain expert atom2valence = torch.tensor(float("nan")).repeat(constant.NUM_ATOM) - for k, v in self.atom2valence: + for k, v in self.atom2valence.items(): atom2valence[k] = v atom2valence = torch.as_tensor(atom2valence, device=self.device)