51 : m_code(code), m_message(message) {}
54 std::string message()
const {
return m_message; }
58 std::string m_message;
62inline const char* to_string(
ErrorCode code) {
64 case ErrorCode::InvalidArgument:
return "InvalidArgument";
65 case ErrorCode::OutOfMemory:
return "OutOfMemory";
66 case ErrorCode::RuntimeError:
return "RuntimeError";
67 default:
return "UnknownError";
72inline std::ostream& operator<<(std::ostream& os,
const NeuralError& err) {
73 os <<
"[" << to_string(err.code()) <<
"] " << err.message();
Represents an error that occurred in the neural network module and contains the error type and messag...
Definition NeuralError.h:48
ErrorCode
Error codes for the neural network module.
Definition NeuralError.h:29
NN Neural Network Library containing Tensor and NeuralNet classes for inference.
Definition NeuralError.h:13