Skip to content

Commit

Permalink
[TFLite] Quantized unary elemwise ops (#10566)
Browse files Browse the repository at this point in the history
* [TFLite] Quantized unary elemwise ops

* fix cos
  • Loading branch information
leeexyz authored Mar 14, 2022
1 parent 5eb93df commit 8bddaab
Show file tree
Hide file tree
Showing 2 changed files with 197 additions and 332 deletions.
18 changes: 0 additions & 18 deletions python/tvm/relay/frontend/tflite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,36 +1141,22 @@ def convert_abs(self, op):

def convert_ceil(self, op):
"""Convert TFLite CEIL"""
if self.is_quantized(op):
raise tvm.error.OpNotImplemented("TFlite quantized CEIL operator is not supported yet.")
return self._convert_unary_elemwise(_op.ceil, op)

def convert_floor(self, op):
"""Convert TFLite FLOOR"""
if self.is_quantized(op):
raise tvm.error.OpNotImplemented(
"TFlite quantized FLOOR operator is not supported yet."
)
return self._convert_unary_elemwise(_op.floor, op)

def convert_round(self, op):
"""Convert TFLite ROUND"""
if self.is_quantized(op):
raise tvm.error.OpNotImplemented(
"TFlite quantized ROUND operator is not supported yet."
)
return self._convert_unary_elemwise(_op.round, op)

def convert_exp(self, op):
"""Convert TFLite EXP"""
if self.is_quantized(op):
raise tvm.error.OpNotImplemented("TFlite quantized EXP operator is not supported yet.")
return self._convert_unary_elemwise(_op.exp, op)

def convert_log(self, op):
"""Convert TFLite LOG"""
if self.is_quantized(op):
raise tvm.error.OpNotImplemented("TFlite quantized LOG operator is not supported yet.")
return self._convert_unary_elemwise(_op.log, op)

def convert_sin(self, op):
Expand All @@ -1179,14 +1165,10 @@ def convert_sin(self, op):

def convert_tan(self, op):
"""Convert TFLite TAN"""
if self.is_quantized(op):
raise tvm.error.OpNotImplemented("TFlite quantized TAN operator is not supported yet.")
return self._convert_unary_elemwise(_op.tan, op)

def convert_cos(self, op):
"""Convert TFLite COS"""
if self.is_quantized(op):
raise tvm.error.OpNotImplemented("TFlite quantized COS operator is not supported yet.")
return self._convert_unary_elemwise(_op.cos, op)

def convert_sqrt(self, op):
Expand Down
Loading

0 comments on commit 8bddaab

Please sign in to comment.