Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinicore
Commits
11aa0c14
Unverified
Commit
11aa0c14
authored
Dec 06, 2025
by
PanZezhong1725
Committed by
GitHub
Dec 06, 2025
Browse files
issue/719 add more logs
parent
0f5e66ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
include/infinicore/nn/module.hpp
include/infinicore/nn/module.hpp
+1
-0
src/infinicore/utils.hpp
src/infinicore/utils.hpp
+13
-10
No files found.
include/infinicore/nn/module.hpp
View file @
11aa0c14
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include <type_traits>
#include <type_traits>
#include <unordered_map>
#include <unordered_map>
#include <vector>
#include <vector>
#include <spdlog/spdlog.h>
namespace
infinicore
::
nn
{
namespace
infinicore
::
nn
{
class
Module
{
class
Module
{
...
...
src/infinicore/utils.hpp
View file @
11aa0c14
...
@@ -33,14 +33,17 @@ inline struct SpdlogInitializer {
...
@@ -33,14 +33,17 @@ inline struct SpdlogInitializer {
} \
} \
} while (false)
} while (false)
#define INFINICORE_ASSERT_TENSORS_SAME_DEVICE(FIRST___, ...) \
#define INFINICORE_ASSERT_TENSORS_SAME_DEVICE(FIRST___, ...) \
do { \
do { \
const auto &first_device___ = (FIRST___)->device(); \
const auto &first_device___ = (FIRST___)->device(); \
for (const auto &tensor___ : {__VA_ARGS__}) { \
for (const auto &tensor___ : {__VA_ARGS__}) { \
if (first_device___ != (tensor___)->device()) { \
if (first_device___ != (tensor___)->device()) { \
throw std::runtime_error("Tensor devices mismatch " \
throw std::runtime_error("Tensor devices mismatch " \
+ first_device___.toString() + " vs " \
+ first_device___.toString() + " vs " \
+ (tensor___)->device().toString() + "."); \
+ (tensor___)->device().toString() \
} \
+ " from " + std::string(__func__) \
} \
+ " at " + std::string(__FILE__) \
+ ":" + std::to_string(__LINE__) + "."); \
} \
} \
} while (0)
} while (0)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment