提交 6137adc0 编写于 作者: M Megvii Engine Team

feat(core): move more exceptions to base exception

mgb::cg::GraphError
mgb::NumRangeChecker::Error
mgb::VarSanityCheck::Error
GitOrigin-RevId: 4d79e3629c480f651af7ff54cb5c870f60db5159
上级 49f02e71
......@@ -48,6 +48,15 @@
namespace mgb {
class GraphError : public MegBrainError {
public:
using MegBrainError::MegBrainError;
};
} // namespace mgb
namespace mgb {
//! computing graph
namespace cg {
......@@ -55,11 +64,7 @@ namespace static_infer {
struct DepElement;
};
class GraphError: public MegBrainError {
public:
using MegBrainError::MegBrainError;
};
using GraphError = mgb::GraphError;
class OperatorNodeBase;
class ComputingGraph;
......
......@@ -16,6 +16,13 @@
#include "megbrain/graph/event.h"
#include "megbrain/utils/thin/hash_table.h"
namespace mgb {
class NumRangeCheckerError final : public MegBrainError {
public:
using MegBrainError::MegBrainError;
};
} // namespace mgb
namespace mgb {
/*!
......@@ -47,11 +54,7 @@ namespace mgb {
std::string format_msg(const HostTensorND &hv, float range);
public:
class Error final: public MegBrainError {
public:
using MegBrainError::MegBrainError;
};
using Error = NumRangeCheckerError;
NumRangeChecker(cg::ComputingGraph *graph, float range);
};
}
......
......@@ -20,6 +20,13 @@
#include <cstdint>
#include <thread>
namespace mgb {
class VarSanityCheckError : public MegBrainError {
public:
using MegBrainError::MegBrainError;
};
} // namespace mgb
namespace mgb {
/*!
......@@ -87,10 +94,7 @@ class VarSanityCheck final : public PluginBase {
public:
VarSanityCheck(cg::ComputingGraph* graph);
class Error : public MegBrainError {
public:
using MegBrainError::MegBrainError;
};
using Error = VarSanityCheckError;
/*!
* \brief perform basic sanity check after opr exec
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册