@register_annotate_function("nn.global_avg_pool2d")
    def global_avg_pool2d_rewrite(ref_call, new_args, ctx):
        """Rewrite function for global_avg_pool2d for stopping quantize"""
        if quantize_context().check_to_skip(ref_call):
            return None

        expr, x_kind = _get_expr_kind(new_args[0])

        if x_kind is None:
            return None
        expr = _forward_op(ref_call, [new_args[0].realize()])

        # stop quantize after global_avg_pool2d
        quantize_context().stop_quantize()
        return expr





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/why-stop-quantize-after-first-nn-global-avg-pool2d/8225/1)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/818d13328134cfd17179c26cb8b0c0deca0a4e34119ccd77a4f276cfd1f6ca59).

Reply via email to