Commit 16abe31c by eqy Committed by ziheng

[Quantization][RELAY] Add check against NCHWc ops in the quantization pass (#2646)

* check in

* fix typo

* fix typo

* change message

* change message

* typo

* lint
parent c4f03de3
#pylint: disable=unused-argument
"""Internal module for registering attribute for annotation."""
from __future__ import absolute_import
import warnings
import topi
from . import _quantize
......@@ -118,6 +119,14 @@ def attach_simulated_quantize(data, kind, sign=True, rounding="round"):
data, dom_scale, clip_min, clip_max, kind, sign, rounding)
@register_annotate_function("nn.contrib_conv2d_NCHWc")
def conv2d_nchwc_rewrite(ref_call, new_args, ctx):
warnings.warn("NCHWc layout Conv2D detected, please use a lower "
"optimization level before applying the quantization "
"pass as quantization will have no effect here...")
return None
@register_annotate_function("nn.conv2d")
def conv2d_rewrite(ref_call, new_args, ctx):
"""Rewrite function for conv2d. Lhs of conv will be quantized to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment