Skip to content

Commit

Permalink
Merge branch 'master' into teq_absorb
Browse files Browse the repository at this point in the history
  • Loading branch information
yiliu30 authored Jul 3, 2024
2 parents d8ce3e0 + 63b2912 commit 9cb3a63
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 552 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@
from neural_compressor.tensorflow.quantization.utils.graph_rewriter.graph_base import GraphRewriterBase
from neural_compressor.tensorflow.quantization.utils.graph_util import GraphAnalyzer
from neural_compressor.tensorflow.quantization.utils.graph_util import GraphRewriterHelper as Helper
from neural_compressor.tensorflow.utils import SPR_BASE_VERSIONS


class FuseGeluOptimizer(GraphRewriterBase): # pragma: no cover
"""Fuse Sqrt + RealDiv + Erf + AddV2 + Mul + Mul into Gelu op."""

def do_transformation(self):
"""Execute the fusion from small ops to Gelu."""
if not (tf.version.VERSION in ("1.15.0-up2", "1.15.0-up3") or tf.version.VERSION in SPR_BASE_VERSIONS):
if tf.version.VERSION not in ("1.15.0-up2", "1.15.0-up3"):
return self.model

cur_graph = GraphAnalyzer()
Expand Down
Loading

0 comments on commit 9cb3a63

Please sign in to comment.