This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch unity
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/unity by this push:
     new 730d380ff6 [Fix] Fix merge error
730d380ff6 is described below

commit 730d380ff6712e01531ce3142743a82a9ec729cd
Author: tqchen <[email protected]>
AuthorDate: Sat Jun 24 20:10:24 2023 -0400

    [Fix] Fix merge error
---
 python/tvm/topi/hexagon/qnn/nn.py | 37 -------------------------------------
 1 file changed, 37 deletions(-)

diff --git a/python/tvm/topi/hexagon/qnn/nn.py 
b/python/tvm/topi/hexagon/qnn/nn.py
index 501d6a222f..28eea59e59 100644
--- a/python/tvm/topi/hexagon/qnn/nn.py
+++ b/python/tvm/topi/hexagon/qnn/nn.py
@@ -48,48 +48,11 @@ def is_relax_constant(expr):
     return hasattr(expr.op, "value") and isinstance(expr.op.value, 
tvm.relax.expr.Constant)
 
 
-# Return True if given expression is scalar constant value.
-def is_scalar(expr):
-    """
-    Return True if given expression is scalar constant value.
-    """
-    if isinstance(expr, te.Tensor):
-        if is_relax_constant(expr):
-            shape = expr.op.value.data.shape
-            dtype = expr.op.value.data.dtype
-            return len(shape) == 0 and ("float" in dtype or "int" in dtype)
-        else:
-            return expr.ndim == 0 and (
-                isinstance(expr.op.body[0], (tvm.tir.FloatImm, tvm.tir.IntImm))
-            )
-    return isinstance(expr, (tvm.tir.FloatImm, tvm.tir.IntImm))
-
-
 def get_relax_scalar_const_value(expr):
     assert len(expr.op.value.data.shape) == 0
     return expr.op.value.data.numpy()[()]
 
 
-def get_const_int_value(expr):
-    if isinstance(expr, te.Tensor):
-        if is_relax_constant(expr):
-            return get_relax_scalar_const_value(expr)
-        else:
-            assert isinstance(expr.op.body[0], tvm.tir.IntImm)
-            return expr.op.body[0].value
-    return get_const_int(expr)
-
-
-def get_const_float_value(expr):
-    if isinstance(expr, te.Tensor):
-        if is_relax_constant(expr):
-            return get_relax_scalar_const_value(expr)
-        else:
-            assert isinstance(expr.op.body[0], tvm.tir.FloatImm)
-            return expr.op.body[0].value
-    return get_const_float(expr)
-
-
 def get_qnn_param(param, indices, axis):
     # Account scalar and 1D quantization parameters:
     if is_scalar(param):

Reply via email to