Skip to content

Commit 4d7dd03

Browse files
jorgep31415facebook-github-bot
authored andcommitted
Throw in VK_GET_OP_FN if op is not found (#3028)
Summary: Pull Request resolved: #3028 Make yipjustin happy. Forgot this safeguard when I originally wrote the `OperatorRegistry` class. Reviewed By: SS-JIA Differential Revision: D56085588 fbshipit-source-id: ba116eab8054e3610011fd0c8ffc0aabe61ae8ea
1 parent cd32712 commit 4d7dd03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backends/vulkan/runtime/graph/ops/OperatorRegistry.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ bool OperatorRegistry::has_op(const std::string& name) {
1616

1717
OperatorRegistry::OpFunction& OperatorRegistry::get_op_fn(
1818
const std::string& name) {
19-
return table_.find(name)->second;
19+
const auto it = table_.find(name);
20+
VK_CHECK_COND(it != table_.end(), "Could not find operator with name ", name);
21+
return it->second;
2022
}
2123

2224
void OperatorRegistry::register_op(const std::string& name, OpFunction& fn) {

0 commit comments

Comments
 (0)