Skip to content

[TMVA][SOFIE] Use uint8_t instead of bool in return types#18302

Merged
dpiparo merged 1 commit intoroot-project:masterfrom
guitargeek:tmva_sofie_bool
Apr 14, 2025
Merged

[TMVA][SOFIE] Use uint8_t instead of bool in return types#18302
dpiparo merged 1 commit intoroot-project:masterfrom
guitargeek:tmva_sofie_bool

Conversation

@guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Apr 7, 2025

The std::vector<bool> is a special class that doesn't wrap contiguous
memory. It limits the usability of the return object (e.g. the memory
can't be adopted copy-free by a NumPy array). It prevents us
from using C-style arrays under the hood and differentiating through the
inference function.

Also, further simplify the code that deals with the return objects.

@guitargeek guitargeek self-assigned this Apr 7, 2025
@guitargeek guitargeek requested a review from lmoneta as a code owner April 7, 2025 16:47
@guitargeek guitargeek changed the title [TMVA][SOFIE] Use char instead of bool in return types [TMVA][SOFIE] Use unsigned char instead of bool in return types Apr 7, 2025
@github-actions
Copy link

github-actions bot commented Apr 7, 2025

Test Results

    18 files      18 suites   4d 19h 7m 10s ⏱️
 2 722 tests  2 719 ✅ 0 💤 3 ❌
47 330 runs  47 327 ✅ 0 💤 3 ❌

For more details on these failures, see this check.

Results for commit 871f7a9.

♻️ This comment has been updated with latest results.

@guitargeek guitargeek force-pushed the tmva_sofie_bool branch 2 times, most recently from ae9e986 to a92a2a0 Compare April 9, 2025 17:43
@guitargeek guitargeek force-pushed the tmva_sofie_bool branch 2 times, most recently from 05d2d4d to 5ebcdff Compare April 11, 2025 09:43
The `std::vector<bool>` is a special class that doesn't wrap contiguous
memory. It limits the usability of the return object (e.g. the memory
can't be adopted copy-free by a NumPy array). It prevents us
from using C-style arrays under the hood and differentiating through the
inference function.
@guitargeek guitargeek changed the title [TMVA][SOFIE] Use unsigned char instead of bool in return types [TMVA][SOFIE] Use uint8_t instead of bool in return types Apr 11, 2025
Copy link
Collaborator

@sanjibansg sanjibansg left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for this contribution Jonas!

@dpiparo dpiparo merged commit 2054385 into root-project:master Apr 14, 2025
19 of 23 checks passed
@guitargeek guitargeek deleted the tmva_sofie_bool branch December 23, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants