Add Module Torch - #213
Open
larissakl wants to merge 12 commits into
Open
Conversation
# Conflicts: # Modules.make # src/Makefile # src/Tools/Flf/Makefile # src/Tools/SpeechRecognizer/Makefile
larissakl
marked this pull request as ready for review
May 11, 2026 12:48
larissakl
commented
May 11, 2026
Passing a literal nullptr to require_ne makes assertionFailedVerbose stream a std::nullptr_t, which is ambiguous in translation units that pull in PyTorch (c10 injects operator<<(ostream&, const nullptr_t&) into namespace std, tying with libstdc++'s own overload). require_notnull compares against 0 and never streams a nullptr_t, sidestepping the ambiguity. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
curufinwe
reviewed
Jul 17, 2026
Comment on lines
+33
to
+38
| #ifdef MODULE_TORCH | ||
| #pragma push_macro("ensure") | ||
| #undef ensure | ||
| #include <Torch/Tensor.hh> | ||
| #pragma pop_macro("ensure") | ||
| #endif |
Contributor
There was a problem hiding this comment.
This macro thing was a TF specific workaround. Did you just copy & paste it or is it also needed for Torch?
Contributor
Author
There was a problem hiding this comment.
It was needed for Torch as well. I don't remember the exact problem, but there some collision with the ensure macro.
Collaborator
There was a problem hiding this comment.
The problem used to be that both numpy headers and RASR define an ensure macro, so the RASR one has to be temporarily disabled when including numpy headers to avoid conflicts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.