You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

operator.cpp 642 B

12345678910111213141516171819202122
  1. #include "megbrain/imperative/operator.h"
  2. namespace mgb {
  3. namespace imperative {
  4. ValueRefList Operator::fallback(Span<ValueRef> inputs) const {
  5. mgb_throw(MegBrainError, "no fallback implementation for %s", to_string().c_str());
  6. }
  7. size_t Operator::register_type(std::type_index type) {
  8. auto& types = const_cast<std::vector<std::type_index>&>(registered_types());
  9. types.push_back(type);
  10. return types.size() - 1;
  11. }
  12. const std::vector<std::type_index>& Operator::registered_types() {
  13. static std::vector<std::type_index> sm_registered_types;
  14. return sm_registered_types;
  15. }
  16. } // namespace imperative
  17. } // namespace mgb