Allow int/float cast to bool (#13391)
Summary:
This PR adds explicit `bool()` casts to match Python semantics
`bool(1) = True`
`bool(0) = False`
`bool(0.0) = False`
`bool(0.1) = True`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13391
Differential Revision: D12871213
Pulled By: driazati
fbshipit-source-id: 773a48b2647973138efe854abe725d647f1d727d