Commit 19a7d710 authored by Robert Kimball's avatar Robert Kimball Committed by Scott Cyphers

Fix topk deserialize to be backwards compatible (#4171)

parent f6fe6aca
......@@ -2943,7 +2943,8 @@ shared_ptr<Node> JSONDeserializer::deserialize_node(json node_js)
{
auto compute_max = node_js.at("compute_max").get<bool>();
auto target_type = read_element_type(node_js.at("index_element_type"));
op::TopKSortType sort = node_js.at("sort").get<op::TopKSortType>();
op::TopKSortType sort =
get_or_default<op::TopKSortType>(node_js, "sort", op::TopKSortType::SORT_VALUES);
if (has_key(node_js, "top_k_axis"))
{
auto top_k_axis = node_js.at("top_k_axis").get<size_t>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment