pytorch-crf icon indicating copy to clipboard operation
pytorch-crf copied to clipboard

Cast mask tensor to bool in torch.where

Open erickrf opened this issue 3 years ago • 7 comments
trafficstars

This fixes #92

erickrf avatar Jan 04 '22 15:01 erickrf

Thanks for the PR! Looks good but I have to confirm it works for earlier PyTorch versions. This is usually done by Travis CI but since the move to travis.com the builds seem to have stopped. It'll be while before I can fix it ☹️

kmkurn avatar Jan 08 '22 05:01 kmkurn

Hi, I've setup Github CI to replace Travis, so do you mind rebasing this PR onto the master branch?

kmkurn avatar Jan 16 '22 09:01 kmkurn

Done!

erickrf avatar Jan 17 '22 15:01 erickrf

Oh... I hadn't realized tensor.bool() wasn't available in previous versions of pytorch. By the way, the project requirements don't say anything about pytorch version, this is only set in the test config. Do you want to support pytorch 1.0?

erickrf avatar Jan 18 '22 09:01 erickrf

project requirements don't say anything about pytorch version, this is only set in the test config

Yes, this is intentional as there are several ways to install pytorch depending on the platform and if GPU support is needed. Can't really put all these in a single requirement (not sure if this has changed?).

Do you want to support pytorch 1.0?

As pytorch is now at v1.10, perhaps dropping support for much earlier versions like v1.0 isn't a bad idea. Do you know when Tensor.bool() was introduced?

kmkurn avatar Jan 18 '22 10:01 kmkurn

Do you know when Tensor.bool() was introduced?

@kmkurn , based off of https://github.com/pytorch/pytorch/pull/16810 and https://github.com/pytorch/pytorch/commit/aa6403bae6aeb452bd464a6ec4913d1b69548aca, it looks like it was introduced in v1.1.0

myedibleenso avatar Apr 20 '22 07:04 myedibleenso

Thanks @myedibleenso. The builds for PyTorch v1.1 have failed. I can't see the log any more so I'm not sure why. I can't seem to re-run the builds either ☹️

kmkurn avatar May 15 '22 00:05 kmkurn