Skip to content

Commit fedc0c6

Browse files
committed
Revert "[topi][relay] add operation tan to TVM (apache#4938)"
This reverts commit d992468.
1 parent f346c60 commit fedc0c6

28 files changed

Lines changed: 3 additions & 155 deletions

File tree

docs/frontend/tensorflow.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ Supported Ops
135135
- ConcatV2
136136
- Conv2D
137137
- Cos
138-
- Tan
139138
- CropAndResize
140139
- DecodeJpeg
141140
- DepthwiseConv2dNative

include/tvm/tir/op.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ TVM_DECLARE_INTRIN_UNARY(sqrt);
515515
TVM_DECLARE_INTRIN_UNARY(rsqrt);
516516
TVM_DECLARE_INTRIN_UNARY(log);
517517
TVM_DECLARE_INTRIN_UNARY(popcount);
518-
TVM_DECLARE_INTRIN_UNARY(tan);
519518
TVM_DECLARE_INTRIN_UNARY(cos);
520519
TVM_DECLARE_INTRIN_UNARY(sin);
521520
TVM_DECLARE_INTRIN_UNARY(atan);

python/tvm/relay/frontend/mxnet.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,6 @@ def _get_bias_requantize_scale(_inputs, _data_scale, _kernel_scale):
16961696
"ones_like",
16971697
"where",
16981698
"gather_nd",
1699-
"tan",
17001699
"cos",
17011700
"sin"
17021701
]

python/tvm/relay/frontend/tensorflow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,6 @@ def _impl(inputs, attr, params):
15721572
'LessEqual' : _broadcast('less_equal'),
15731573
'Log' : AttrCvt('log'),
15741574
'Log1p' : _log1p(),
1575-
'Tan' : AttrCvt('tan'),
15761575
'Cos' : AttrCvt('cos'),
15771576
'Sin' : AttrCvt('sin'),
15781577
'LogicalAnd' : _logical('logical_and'),

python/tvm/relay/frontend/tflite.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def __init__(self, model, subgraph, exp_tab):
6868
'LOG': self.convert_log,
6969
'SIN': self.convert_sin,
7070
'COS': self.convert_cos,
71-
'TAN': self.convert_tan,
7271
'SQRT': self.convert_sqrt,
7372
'RSQRT': self.convert_rsqrt,
7473
'NEG': self.convert_neg,
@@ -658,13 +657,6 @@ def convert_sin(self, op):
658657
'TFlite quantized SIN operator is not supported yet.')
659658
return self._convert_unary_elemwise(_op.sin, op)
660659

661-
def convert_tan(self, op):
662-
"""Convert TFLite TAN"""
663-
if self.is_quantized(op):
664-
raise tvm.error.OpNotImplemented(
665-
'TFlite quantized TAN operator is not supported yet.')
666-
return self._convert_unary_elemwise(_op.tan, op)
667-
668660
def convert_cos(self, op):
669661
"""Convert TFLite COS"""
670662
if self.is_quantized(op):

python/tvm/relay/op/_tensor.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828

2929
register_broadcast_schedule("log")
30-
register_broadcast_schedule("tan")
3130
register_broadcast_schedule("cos")
3231
register_broadcast_schedule("sin")
3332
register_broadcast_schedule("atan")
@@ -215,4 +214,3 @@ def elemwise_shape_func(attrs, inputs, _):
215214
register_shape_func("sqrt", False, elemwise_shape_func)
216215
register_shape_func("negative", False, elemwise_shape_func)
217216
register_shape_func("exp", False, elemwise_shape_func)
218-
register_shape_func("tan", False, elemwise_shape_func)

python/tvm/relay/op/_tensor_grad.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@ def log_grad(orig, grad):
6161
return [grad * ones_like(x) / x]
6262

6363

64-
@register_gradient("tan")
65-
def tan_grad(orig, grad):
66-
"""Returns [grad / (cos^2(x))]"""
67-
x = orig.args[0]
68-
return [grad / (cos(x) * cos(x))]
69-
70-
7164
@register_gradient("cos")
7265
def cos_grad(orig, grad):
7366
"""Returns [grad * (-sin(x))]"""

python/tvm/relay/op/tensor.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,6 @@ def log(data):
4747
"""
4848
return _make.log(data)
4949

50-
def tan(data):
51-
"""Compute elementwise tan of data.
52-
53-
Parameters
54-
----------
55-
data : relay.Expr
56-
The input data
57-
58-
Returns
59-
-------
60-
result : relay.Expr
61-
The computed result.
62-
"""
63-
return _make.tan(data)
64-
6550
def cos(data):
6651
"""Compute elementwise cos of data.
6752

python/tvm/te/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"""
2020
# expose all operators in tvm tir.op
2121
from tvm.tir import any, all, min_value, max_value, trace
22-
from tvm.tir import exp, erf, tanh, sigmoid, log, tan, cos, sin, atan, sqrt, rsqrt, floor, ceil
22+
from tvm.tir import exp, erf, tanh, sigmoid, log, cos, sin, atan, sqrt, rsqrt, floor, ceil
2323
from tvm.tir import trunc, abs, round, nearbyint, isnan, power, popcount, fmod, if_then_else
2424
from tvm.tir import div, indexdiv, indexmod, truncdiv, truncmod, floordiv, floormod
2525
from tvm.tir import comm_reducer, min, max, sum

python/tvm/tir/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
from .op import call_packed, call_pure_intrin, call_intrin, call_pure_extern, call_extern
3535
from .op import call_llvm_intrin, all, any, min_value, max_value, trace
36-
from .op import exp, erf, tanh, sigmoid, log, tan, cos, sin, atan, sqrt, rsqrt, floor, ceil
36+
from .op import exp, erf, tanh, sigmoid, log, cos, sin, atan, sqrt, rsqrt, floor, ceil
3737
from .op import trunc, abs, round, nearbyint, isnan, power, popcount, fmod, if_then_else
3838
from .op import div, indexdiv, indexmod, truncdiv, truncmod, floordiv, floormod
3939
from .op import comm_reducer, min, max, sum

0 commit comments

Comments
 (0)