Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel bitwise_or #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

kernel bitwise_or #158

wants to merge 2 commits into from

Conversation

Janicewei
Copy link
Contributor

bitwise_or with two tensor inputs, supports int and bool types

Tensor or_kernel_hb(const Tensor& self, const Tensor& other) {
TORCH_CHECK(self.numel() == other.numel(), "The size of two tensors should match.");
// TORCH_CHECK(self.scalar_type() == ScalarType::Int || self.scalar_type() == ScalarType::Bool, "HammerBlade or is implemented for Int and Bool only");
// TORCH_CHECK(other.scalar_type() == ScalarType::Int || other.scalar_type() == ScalarType::Bool, "HammerBlade or is implemented for Int and Bool only");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as and, I think if you do self.scalar_type() == kInt it will work
Maybe you need at::kInt ...

hb_tensor_t* t0_p,
hb_tensor_t* t1_p,
hb_tensor_t* t2_p) {
auto res = HBTensor<int>(t0_p);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to and, we need to handle booleans and test for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants