Skip to content

Commit 9b2019b

Browse files
committed
[ET-VK][EZ] Throw in VK_GET_OP_FN if op is not found
Make yipjustin happy. Forgot this safeguard when I originally wrote the `OperatorRegistry` class. Differential Revision: [D56085588](https://our.internmc.facebook.com/intern/diff/D56085588/) ghstack-source-id: 222384998 Pull Request resolved: #3028
1 parent 5b7c4ba commit 9b2019b

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)