mgb::cg::GraphError
mgb::NumRangeChecker::Error
mgb::VarSanityCheck::Error
GitOrigin-RevId: 4d79e3629c
release-0.6
@@ -48,6 +48,15 @@ | |||||
namespace mgb { | namespace mgb { | ||||
class GraphError : public MegBrainError { | |||||
public: | |||||
using MegBrainError::MegBrainError; | |||||
}; | |||||
} // namespace mgb | |||||
namespace mgb { | |||||
//! computing graph | //! computing graph | ||||
namespace cg { | namespace cg { | ||||
@@ -55,11 +64,7 @@ namespace static_infer { | |||||
struct DepElement; | struct DepElement; | ||||
}; | }; | ||||
class GraphError: public MegBrainError { | |||||
public: | |||||
using MegBrainError::MegBrainError; | |||||
}; | |||||
using GraphError = mgb::GraphError; | |||||
class OperatorNodeBase; | class OperatorNodeBase; | ||||
class ComputingGraph; | class ComputingGraph; | ||||
@@ -17,6 +17,13 @@ | |||||
#include "megbrain/utils/thin/hash_table.h" | #include "megbrain/utils/thin/hash_table.h" | ||||
namespace mgb { | namespace mgb { | ||||
class NumRangeCheckerError final : public MegBrainError { | |||||
public: | |||||
using MegBrainError::MegBrainError; | |||||
}; | |||||
} // namespace mgb | |||||
namespace mgb { | |||||
/*! | /*! | ||||
* \brief check that the absolute values of all numbers in a computing graph | * \brief check that the absolute values of all numbers in a computing graph | ||||
@@ -47,11 +54,7 @@ namespace mgb { | |||||
std::string format_msg(const HostTensorND &hv, float range); | std::string format_msg(const HostTensorND &hv, float range); | ||||
public: | public: | ||||
class Error final: public MegBrainError { | |||||
public: | |||||
using MegBrainError::MegBrainError; | |||||
}; | |||||
using Error = NumRangeCheckerError; | |||||
NumRangeChecker(cg::ComputingGraph *graph, float range); | NumRangeChecker(cg::ComputingGraph *graph, float range); | ||||
}; | }; | ||||
} | } | ||||
@@ -21,6 +21,13 @@ | |||||
#include <thread> | #include <thread> | ||||
namespace mgb { | namespace mgb { | ||||
class VarSanityCheckError : public MegBrainError { | |||||
public: | |||||
using MegBrainError::MegBrainError; | |||||
}; | |||||
} // namespace mgb | |||||
namespace mgb { | |||||
/*! | /*! | ||||
* \brief check that content of a variable does not change between when it | * \brief check that content of a variable does not change between when it | ||||
@@ -87,10 +94,7 @@ class VarSanityCheck final : public PluginBase { | |||||
public: | public: | ||||
VarSanityCheck(cg::ComputingGraph* graph); | VarSanityCheck(cg::ComputingGraph* graph); | ||||
class Error : public MegBrainError { | |||||
public: | |||||
using MegBrainError::MegBrainError; | |||||
}; | |||||
using Error = VarSanityCheckError; | |||||
/*! | /*! | ||||
* \brief perform basic sanity check after opr exec | * \brief perform basic sanity check after opr exec | ||||