MCPcopy Create free account
hub / github.com/JDAI-CV/DNNLibrary / get_input_param

Function get_input_param

generate_code.py:262–274  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

260 f"shaper_.{op['shaper']}({', '.join(shaper_params)});")
261
262 def get_input_param(x):
263 if x['cpp_type'] == 'str':
264 return f"m({x['name']}).c_str()"
265 elif x['cpp_type'] == 'optional_str':
266 return f"{x['name']}.has_value() ? {x['name']}.value().c_str() : nullptr"
267 elif x['cpp_type'] == 'str_list':
268 return f"&{x['name']}_fb"
269 elif x['cpp_type'] == 'int32_list':
270 return f"&{x['name']}"
271 elif x['predefined'] == 'fuse_code':
272 return f"ConvertFuseCodeType({x['name']})"
273 else:
274 return x['name']
275
276 cogout(f"const auto input_param = DNN::Create{op['nnapi']}_InputDirect(builder_, ")
277 cogout(', '.join(list(map(get_input_param, op['input']))))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected