blob: fbd84eb25f7a987f658ec8e09fe85b7f0083a7cd [file] [log] [blame]
#include "ATen/Utils.h"
#include <stdarg.h>
#include <stdexcept>
#include <typeinfo>
namespace at {
void runtime_error(const char *format, ...) {
static const size_t ERROR_BUF_SIZE = 1024;
char error_buf[ERROR_BUF_SIZE];
va_list fmt_args;
va_start(fmt_args, format);
vsnprintf(error_buf, ERROR_BUF_SIZE, format, fmt_args);
va_end(fmt_args);
throw std::runtime_error(error_buf);
}
} // at