Files
openvino/model-optimizer/extensions/front/disable_weights_quantize_value_propagation.py
T

26 lines
777 B
Python
Raw Normal View History

# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
2019-08-09 19:02:42 +03:00
from extensions.front.tf.FakeQuantWithMinMaxVars import FakeQuantWithMinMaxVarsToQuantize
from mo.front.common.replacement import FrontReplacementPattern
from mo.graph.graph import Graph
class DisableQuantizeValuePropagation(FrontReplacementPattern):
enabled = True
def run_after(self):
return [FakeQuantWithMinMaxVarsToQuantize]
@staticmethod
def pattern():
return dict(
nodes=[
('quantize', dict(op='FakeQuantize', levels=lambda levels: levels != 2)),
],
2020-02-11 22:48:49 +03:00
edges=[]
2019-08-09 19:02:42 +03:00
)
@staticmethod
def replace_pattern(graph: Graph, match: dict):
match['quantize']['stop_value_propagation'] = True