MCPcopy
hub / github.com/OpenPPL/ppq / format_resize

Method format_resize

ppq/IR/morph.py:246–255  ·  view source on GitHub ↗

升级 opset 10 的 resize 到 opset 11

(self)

Source from the content-addressed store, hash-verified

244 op.attributes.clear()
245
246 def format_resize(self) -> None:
247 """
248 升级 opset 10 的 resize 到 opset 11
249 """
250 for op in self.graph.operations.values():
251 if op.type == 'Resize' and len(op.inputs) == 2:
252 # 创建一个空的 variable, 这个 variable 没有值与 source_op, 也不是 parameter
253 # 这种行为 Onnx 是允许的,这种变量用以传递空值,起到占位符的作用
254 self.graph.create_variable(value=None, is_parameter=False, dest_ops=[op])
255 op.inputs[1], op.inputs[2] = op.inputs[2], op.inputs[1]
256
257 def format_clip(self) -> None:
258 """

Callers 1

processMethod · 0.95

Calls 1

create_variableMethod · 0.80

Tested by

no test coverage detected