One could overcome this issue by creating extra variable
bool_tensor : torch.Tensor = (deltas == deltas) & ~(torch.eq(deltas.abs(), torch._six.inf))
This is how torch.isfinite() was calculated in previous version https://s0pytorch0org.icopy.site/docs/0.4.1/_modules/torch/functional.html 25