YuliaRubanova / latent_ode

Code for "Latent ODEs for Irregularly-Sampled Time Series" paper
MIT License
522 stars 126 forks source link

A small bug causes RuntimeError with PyTorch 1.4.0 #9

Closed AlexandraVolokhova closed 3 years ago

AlexandraVolokhova commented 4 years ago

Hello, @YuliaRubanova! I found a small bug here. This line idx_not_nan = 1 - torch.isnan(mortality_label) causes RuntimeError with PyTorch 1.4.0 because torch.isnan returns torch.BoolTensor, which cannot be subtracted from int. Everything works if substitute this line with the following: idx_not_nan = ~torch.isnan(mortality_label)

AlexandraVolokhova commented 4 years ago

The same problem is here