You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2026/02/02 02:20:43 UTC
[PR] GH-49112: [C++] Support half-float tensors in equality comparison [arrow]
HyukjinKwon opened a new pull request, #49113:
URL: https://github.com/apache/arrow/pull/49113
### Rationale for this change
Half-float (float16) tensor equality comparison was not implemented. The TODO comment indicated this was missing functionality. Array/Scalar equality for half-float was already fixed in 72d20ad719021c5513620e23a0a65fb724f0e299. This PR completes the support by adding tensor comparison.
### What changes are included in this PR?
- Add `HALF_FLOAT` case to `TensorEquals()` and sparse tensor comparison functions
- Enable `TestFloatTensor` for `HalfFloatType`
- Update `static_assert` to allow `HalfFloatType` in tensor comparison templates
### Are these changes tested?
Yes, `TestFloatTensor::Equals`.
### Are there any user-facing changes?
Yes, users can now compare half-float tensors using `Tensor::Equals()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-49112: [C++] Support half-float tensors in equality comparison [arrow]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #49113:
URL: https://github.com/apache/arrow/pull/49113#discussion_r2752295603
##########
cpp/src/arrow/tensor_test.cc:
##########
@@ -505,8 +506,16 @@ TYPED_TEST_P(TestFloatTensor, Equals) {
std::vector<int64_t> shape = {4, 4};
- std::vector<c_data_type> c_values = {1, 2, 3, 4, 5, 6, 7, 8,
+ constexpr int c_vals_as_int_arr[] = {1, 2, 3, 4, 5, 6, 7, 8,
Review Comment:
The variable name is a bit lengthty. Intentionally matched the line length to match with its previous length (so the next line doesn't need the diff). I can change the variable name :-).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org