Just using | would seem to work in C++:
csrc = """
torch::Tensor fn(const torch::Tensor& a, const torch::Tensor& b) {
  return a | b;
}

PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
  m.def("fn", &fn, "test function");
}
"""

ext = torch.utils.cpp_extension.load_inline("test_ext", csrc)
a = torch.tensor([False, True])
print(ext.fn(a, a[:, None]))

Best regards
Thomas