MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / parse_dyn_dims_json

Method parse_dyn_dims_json

src/driver/main.cpp:236–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234 }
235
236 static auto parse_dyn_dims_json(const std::string& dd_json)
237 {
238 // expecting a json string like "[{min:1,max:64,optimals:[1,2,4,8]},3,224,224]"
239 auto v = from_json_string(convert_to_json(dd_json));
240 std::vector<migraphx::shape::dynamic_dimension> dyn_dims;
241 std::transform(v.begin(), v.end(), std::back_inserter(dyn_dims), [&](const auto& x) {
242 if(x.is_object())
243 return from_value<migraphx::shape::dynamic_dimension>(x);
244 auto d = x.template to<std::size_t>();
245 return migraphx::shape::dynamic_dimension{d, d};
246 });
247 return dyn_dims;
248 }
249
250 static auto parse_dyn_dims_map(const std::vector<std::string>& param_dyn_dims)
251 {

Callers

nothing calls this directly

Calls 6

from_json_stringFunction · 0.85
convert_to_jsonFunction · 0.85
is_objectMethod · 0.80
transformFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected