mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
I've kept JIT_ASSERT as an alias to TORCH_ASSERT, which we can use throughout the C++ code.
22 lines
269 B
C++
22 lines
269 B
C++
#include "torch/csrc/assertions.h"
|
|
|
|
#include <cstdarg>
|
|
#include <cstdio>
|
|
|
|
namespace torch {
|
|
|
|
void
|
|
barf(const char *fmt, ...)
|
|
{
|
|
char msg[2048];
|
|
va_list args;
|
|
|
|
va_start(args, fmt);
|
|
vsnprintf(msg, 2048, fmt, args);
|
|
va_end(args);
|
|
|
|
throw assert_error(msg);
|
|
}
|
|
|
|
}
|