Unverified Commit d6932a16 authored by Gao, Xiang's avatar Gao, Xiang Committed by GitHub
Browse files

use .item() instead of type cast (#188)

Fixes: https://github.com/aiqm/torchani/issues/183
parent 55419dfa
......@@ -76,7 +76,7 @@ def present_species(species):
:class:`torch.Tensor`: 1D vector storing present atom types sorted.
"""
present_species, _ = species.flatten()._unique(sorted=True)
if int(present_species[0]) == -1:
if present_species[0].item() == -1:
present_species = present_species[1:]
return present_species
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment