[TensorExpr] Explicitly cast to bool results of comparison ops in kernel.cpp. (#42201)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42201
Previously, we've been using operators <, >, ==, et al. and relied on
the dtype to be picked automatically. It led to a wrong dtype being
picked for the result, but that choice was overwritten by the type
explicitly specified in JIT IR, which we were lowering. Now we are
moving towards using shape inference instead of relying on all types
being specified in the IR, and that made this issue to immediately pop
up.
Test Plan: Imported from OSS
Reviewed By: Krovatkin
Differential Revision: D22806428
Pulled By: ZolotukhinM
fbshipit-source-id: 89d2726340efa2bb3da45d1603bedc53955e14b9
Author
Mikhail Zolotukhin