Skip to content

Commit 92b76df

Browse files
Chilleefacebook-github-bot
authored andcommitted
Finished trigonometric functions (#21128)
Summary: Pull Request resolved: #21128 ghimport-source-id: d566de1 Differential Revision: D15563190 Pulled By: Chillee fbshipit-source-id: ad2e09cac5c7dae9978a7bd61098c2828620cdc4
1 parent 7309cb6 commit 92b76df

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

test/test_jit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6127,9 +6127,9 @@ def func(a, b):
61276127
.format(func_name=func_name, a=a, b=b, res_python=res_python, res_script=res_script))
61286128
self.assertEqual(res_python, res_script, message=msg, prec=(1e-4) * max(abs(res_python), res_script))
61296129

6130-
61316130
unary_float_ops = ["log", "log1p", "log10", "exp", "sqrt", "gamma", "lgamma", "erf",
6132-
"erfc", "expm1", "fabs", "acos", "asin", "atan", "cos", "sin", "tan"]
6131+
"erfc", "expm1", "fabs", "acos", "asin", "atan", "cos", "sin", "tan",
6132+
"asinh", "atanh", "acosh", "sinh", "cosh", "tanh"]
61336133
binary_float_ops = ["atan2", "fmod", "copysign"]
61346134
for op in unary_float_ops:
61356135
checkMathWrap(op)

torch/csrc/jit/register_prim_ops.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,12 @@ RegisterOperators reg2({
21602160
DEFINE_UNARY_OP(aten::cos, std::cos(a), float, float),
21612161
DEFINE_UNARY_OP(aten::sin, std::sin(a), float, float),
21622162
DEFINE_UNARY_OP(aten::tan, std::tan(a), float, float),
2163+
DEFINE_UNARY_OP(aten::asinh, std::asinh(a), float, float),
2164+
DEFINE_UNARY_OP(aten::atanh, std::atanh(a), float, float),
2165+
DEFINE_UNARY_OP(aten::acosh, std::acosh(a), float, float),
2166+
DEFINE_UNARY_OP(aten::sinh, std::sinh(a), float, float),
2167+
DEFINE_UNARY_OP(aten::cosh, std::cosh(a), float, float),
2168+
DEFINE_UNARY_OP(aten::tanh, std::tanh(a), float, float),
21632169
DEFINE_BINARY_FLOAT_OP(aten::fmod, std::fmod(a, b)),
21642170
Operator(
21652171
"aten::modf(float a) -> (float, float)",

torch/jit/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,12 @@ def register_all(mod):
19001900
(math.cos, "aten::cos"),
19011901
(math.sin, "aten::sin"),
19021902
(math.tan, "aten::tan"),
1903+
(math.asinh, "aten::asinh"),
1904+
(math.atanh, "aten::atanh"),
1905+
(math.acosh, "aten::acosh"),
1906+
(math.sinh, "aten::sinh"),
1907+
(math.cosh, "aten::cosh"),
1908+
(math.tanh, "aten::tanh"),
19031909
(math.fmod, "aten::fmod"),
19041910
(math.modf, "aten::modf"),
19051911
(torch._C._infer_size, "aten::_infer_size"),

0 commit comments

Comments
 (0)