idiap / fullgrad-saliency

Full-gradient saliency maps
Other
203 stars 32 forks source link

Fix device #15

Closed IgnacioHeredia closed 1 year ago

IgnacioHeredia commented 2 years ago

Just a quick bugfix. This line should be instead:

cuda = next(self.model.parameters()).is_cuda

to avoid errors when cuda is available but the model has been purposefully been loaded on cpu:

RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same

Thanks for he nice repo!