init v0.23.0

Signed-off-by: Sun Ruoxi <sunruoxi@4paradigm.com>
This commit is contained in:
2026-08-27 15:11:51 +08:00
parent b582a8e7d1
commit 7f8a1b1f7a
2849 changed files with 712887 additions and 22001 deletions

View File

@@ -28,4 +28,28 @@
return PyModule_Create(&module); \
}
class TrochBindException : public std::exception
{
private:
std::string message = {};
public:
explicit TrochBindException(const char *name, const char *file, const int line, const std::string &error)
{
message = std::string("Failed: ") + name + " error " + file + ":" + std::to_string(line) +
" error message or error code is '" + error + "'";
}
const char *what() const noexcept override
{
return message.c_str();
}
};
#define TORCH_BIND_ASSERT(cond) \
; \
do { \
if (not(cond)) { \
throw TrochBindException("Assertion", __FILE__, __LINE__, #cond); \
} \
} while (0)