File indexing completed on 2025-02-22 10:42:43
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #define ONNX_UNUSED_PARAMETER(x) (void)(x)
0010
0011 #ifdef ONNX_NO_EXCEPTIONS
0012 #include <iostream>
0013 #define ONNX_THROW(...) \
0014 do { \
0015 std::cerr << ONNX_NAMESPACE::MakeString(__VA_ARGS__); \
0016 abort(); \
0017 } while (false)
0018
0019 #define ONNX_THROW_EX(ex) \
0020 do { \
0021 std::cerr << ex.what() << std::endl; \
0022 abort(); \
0023 } while (false)
0024
0025 #define ONNX_TRY if (true)
0026 #define ONNX_CATCH(x) else if (false)
0027 #define ONNX_HANDLE_EXCEPTION(func)
0028
0029 #else
0030 #define ONNX_THROW(...) throw std::runtime_error(ONNX_NAMESPACE::MakeString(__VA_ARGS__))
0031 #define ONNX_THROW_EX(ex) throw ex
0032
0033 #define ONNX_TRY try
0034 #define ONNX_CATCH(x) catch (x)
0035 #define ONNX_HANDLE_EXCEPTION(func) func()
0036 #endif