Skip to content

Add Module Torch - #213

Open
larissakl wants to merge 12 commits into
masterfrom
torch-module
Open

Add Module Torch#213
larissakl wants to merge 12 commits into
masterfrom
torch-module

Conversation

@larissakl

Copy link
Copy Markdown
Contributor

No description provided.

larissakl added 2 commits May 8, 2026 15:14
# Conflicts:
#	Modules.make
#	src/Makefile
#	src/Tools/Flf/Makefile
#	src/Tools/SpeechRecognizer/Makefile
@larissakl
larissakl changed the base branch from master to rapidjson May 11, 2026 12:43
@larissakl
larissakl marked this pull request as ready for review May 11, 2026 12:48
Comment thread src/Core/Assertions.hh Outdated
Base automatically changed from rapidjson to master May 15, 2026 12:19
curufinwe and others added 3 commits July 15, 2026 15:00
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>
Comment thread src/Core/Assertions.hh Outdated
Comment on lines +33 to +38
#ifdef MODULE_TORCH
#pragma push_macro("ensure")
#undef ensure
#include <Torch/Tensor.hh>
#pragma pop_macro("ensure")
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This macro thing was a TF specific workaround. Did you just copy & paste it or is it also needed for Torch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was needed for Torch as well. I don't remember the exact problem, but there some collision with the ensure macro.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment thread src/Core/Assertions.hh Outdated
Comment thread cmake_resources/Torch.cmake Outdated
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.

3 participants