diff --git a/docs/ops/arithmetic/Atan_1.md b/docs/ops/arithmetic/Atan_1.md index cd56a54fdbbb01..7fc9525bf6622c 100644 --- a/docs/ops/arithmetic/Atan_1.md +++ b/docs/ops/arithmetic/Atan_1.md @@ -16,7 +16,7 @@ a_{i} = atan(a_{i}) **Inputs** -* **1**: An tensor of type *T* and arbitrary shape. **Required.** +* **1**: A tensor of type *T* and arbitrary shape. **Required.** **Outputs** diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/activation.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/activation.cpp index 11a2c41a68e52c..61f11d4ba5dee9 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/activation.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/activation.cpp @@ -65,6 +65,7 @@ const std::map>> activationTypes // List of operations that should be tested also with integer precision const std::map>> intActivationTypes = { + {Atan, {}}, {Negative, {}}, {Ceiling, {}}, {Cos, {}}, diff --git a/ngraph/core/reference/include/ngraph/runtime/reference/atan.hpp b/ngraph/core/reference/include/ngraph/runtime/reference/atan.hpp index 03dcdf525f269c..f5510b4edd7987 100644 --- a/ngraph/core/reference/include/ngraph/runtime/reference/atan.hpp +++ b/ngraph/core/reference/include/ngraph/runtime/reference/atan.hpp @@ -13,7 +13,7 @@ namespace ngraph { namespace reference { - template + template ::value, bool>::type = true> void atan(const T* arg, T* out, size_t count) { for (size_t i = 0; i < count; i++) @@ -21,6 +21,14 @@ namespace ngraph out[i] = std::atan(arg[i]); } } + template ::value, bool>::type = true> + void atan(const T* arg, T* out, size_t count) + { + for (size_t i = 0; i < count; i++) + { + out[i] = std::roundl(std::atan(arg[i])); + } + } } // namespace reference } // namespace runtime } // namespace ngraph diff --git a/ngraph/test/backend/atan.in.cpp b/ngraph/test/backend/atan.in.cpp index 8a8f29bd0abbf2..5c5e4f79bfcbff 100644 --- a/ngraph/test/backend/atan.in.cpp +++ b/ngraph/test/backend/atan.in.cpp @@ -31,7 +31,7 @@ using namespace ngraph; static string s_manifest = "${MANIFEST}"; using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME}); -NGRAPH_TEST(${BACKEND_NAME}, atan) +NGRAPH_TEST(${BACKEND_NAME}, atan_float) { Shape shape{11}; auto A = make_shared(element::f32, shape); @@ -53,3 +53,16 @@ NGRAPH_TEST(${BACKEND_NAME}, atan) 1.32581766f}); test_case.run(); } + +NGRAPH_TEST(${BACKEND_NAME}, atan_int) +{ + Shape shape{5}; + auto A = make_shared(element::i32, shape); + auto f = make_shared(make_shared(A), ParameterVector{A}); + + auto test_case = test::TestCase(f); + test_case.add_input({-2, -1, 0, 1, 2}); + test_case.add_expected_output(shape, + {-1, -1, 0, 1, 1}); + test_case.run(); +}