Files
pytorch/torch/csrc/assertions.cpp
Sam Gross afdf50cafe Move jit/assert.h to csrc/assertions.h (#3442)
I've kept JIT_ASSERT as an alias to TORCH_ASSERT, which we can use throughout the C++ code.
2017-11-02 13:26:51 -04:00

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);
}
}