MCPcopy Create free account
hub / github.com/XiaoMi/mace / remove_initializer_from_input

Function remove_initializer_from_input

tools/python/validate.py:348–362  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

346
347# Remove annoying warning from onnxruntime.
348def remove_initializer_from_input(model):
349 if model.ir_version < 4:
350 print(
351 'Model with ir_version below 4 requires to include initilizer in graph input' # noqa
352 )
353 return in_path
354
355 inputs = model.graph.input
356 name_to_input = {}
357 for input in inputs:
358 name_to_input[input.name] = input
359
360 for initializer in model.graph.initializer:
361 if initializer.name in name_to_input:
362 inputs.remove(name_to_input[initializer.name])
363
364
365def validate_onnx_model(platform, model_file,

Callers 1

validate_onnx_modelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected