Comparison operators

The comparison operator > seems to return a at::Tensor type.
How do I convert it into a boolean to use in an if statement.
Or does it just return 0 or 1 for false and true?

In general, am I missing something or the documentation for the C++ API is very poor?

tensor.item<bool>(); should work.
Contributions to improve the docs are more than welcome :wink:

1 Like

Thanks!
I have contributed to the Python docs before, and I would definitely contribute to the C++ docs if my C++ was so rusty :smiley:

1 Like