op/atan.hpp
op/atanh.cpp
op/atanh.hpp
- op/atan2.cpp
- op/atan2.hpp
op/avg_pool.cpp
op/avg_pool.hpp
op/batch_norm.cpp
NGRAPH_OP(Asinh, ngraph::op::v3, 3)
NGRAPH_OP(Atan, ngraph::op::v0, 0)
NGRAPH_OP(Atanh, ngraph::op::v3, 3)
-NGRAPH_OP(Atan2, ngraph::op::v0, 0)
NGRAPH_OP(AvgPool, ngraph::op::v1, 1)
NGRAPH_OP(BatchMatMul, ngraph::op::v0, 0)
NGRAPH_OP(BatchMatMulTranspose, ngraph::op::v0, 0)
#include "ngraph/op/asinh.hpp"
#include "ngraph/op/assign.hpp"
#include "ngraph/op/atan.hpp"
-#include "ngraph/op/atan2.hpp"
#include "ngraph/op/atanh.hpp"
#include "ngraph/op/avg_pool.hpp"
#include "ngraph/op/batch_norm.hpp"
#include "ngraph/op/add.hpp"
#include "ngraph/op/asin.hpp"
#include "ngraph/op/atan.hpp"
-#include "ngraph/op/atan2.hpp"
#include "ngraph/op/broadcast.hpp"
#include "ngraph/op/ceiling.hpp"
#include "ngraph/op/constant.hpp"
{TI(op::Acos), cse_unarywise},
{TI(op::Asin), cse_unarywise},
{TI(op::Atan), cse_unarywise},
- {TI(op::Atan2), cse_binarywise},
{TI(op::Ceiling), cse_unarywise},
{TI(op::Constant), cse_constant},
{TI(op::Cos), cse_unarywise},
node = make_shared<op::Atan>(args[0]);
break;
}
- case OP_TYPEID::Atan2:
- {
- node = make_shared<op::Atan2>(args[0], args[1], read_auto_broadcast(node_js, "autob"));
- break;
- }
case OP_TYPEID::BatchMatMul:
{
}
case OP_TYPEID::Atan: { break;
}
- case OP_TYPEID::Atan2:
- {
- auto tmp = dynamic_cast<const op::Atan2*>(&n);
- if (tmp->get_autob().m_type != op::AutoBroadcastType::NONE)
- {
- node["autob"] = write_auto_broadcast(tmp->get_autob());
- }
- break;
- }
case OP_TYPEID::BatchMatMul: { break;
}
case OP_TYPEID::BatchMatMulTranspose:
backend/asin.in.cpp
backend/asinh.in.cpp
backend/atan.in.cpp
- backend/atan2.in.cpp
backend/atanh.in.cpp
backend/auto_broadcast.in.cpp
backend/autodiff.in.cpp
+++ /dev/null
-//*****************************************************************************
-// Copyright 2017-2020 Intel Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//*****************************************************************************
-
-#include <algorithm>
-#include <cinttypes>
-#include <cmath>
-#include <cstdlib>
-#include <random>
-#include <string>
-
-// clang-format off
-#ifdef ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
-#define DEFAULT_FLOAT_TOLERANCE_BITS ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
-#endif
-
-#ifdef ${BACKEND_NAME}_DOUBLE_TOLERANCE_BITS
-#define DEFAULT_DOUBLE_TOLERANCE_BITS ${BACKEND_NAME}_DOUBLE_TOLERANCE_BITS
-#endif
-// clang-format on
-
-#include "gtest/gtest.h"
-#include "ngraph/ngraph.hpp"
-#include "runtime/backend.hpp"
-#include "ngraph/runtime/tensor.hpp"
-#include "util/all_close.hpp"
-#include "util/all_close_f.hpp"
-#include "util/ndarray.hpp"
-#include "util/test_control.hpp"
-#include "util/test_tools.hpp"
-
-using namespace std;
-using namespace ngraph;
-
-static string s_manifest = "${MANIFEST}";
-
-NGRAPH_TEST(${BACKEND_NAME}, atan2)
-{
- Shape shape{30};
- auto X = make_shared<op::Parameter>(element::f32, shape);
- auto Y = make_shared<op::Parameter>(element::f32, shape);
- auto f = make_shared<Function>(make_shared<op::Atan2>(Y, X), ParameterVector{X, Y});
-
- auto backend = runtime::Backend::create("${BACKEND_NAME}");
-
- // Create some tensors for input/output
- shared_ptr<runtime::Tensor> x = backend->create_tensor(element::f32, shape);
- shared_ptr<runtime::Tensor> y = backend->create_tensor(element::f32, shape);
- shared_ptr<runtime::Tensor> result = backend->create_tensor(element::f32, shape);
-
- std::vector<float> xref;
- std::vector<float> yref;
- std::vector<float> zref;
- int halfelts = shape.at(0) / 2;
- float scale = 1.0 / (halfelts * 4.0 * std::atan(1.0));
- for (int i = 0; i < halfelts; ++i)
- {
- float theta = i * scale;
- zref.push_back(theta);
- xref.push_back(static_cast<float>((i + 1) * std::cos(theta)));
- yref.push_back(static_cast<float>((i + 1) * std::sin(theta)));
- zref.push_back(-theta);
- xref.push_back(static_cast<float>((i + 1) * std::cos(-theta)));
- yref.push_back(static_cast<float>((i + 1) * std::sin(-theta)));
- }
-
- copy_data(x, xref);
- copy_data(y, yref);
-
- auto handle = backend->compile(f);
- handle->call_with_validate({result}, {x, y});
- EXPECT_TRUE(test::all_close_f(read_vector<float>(result), (zref)));
-}
EXPECT_TRUE(autodiff_numeric_compare<float>(backend.get(), make_graph, {x0}, .01f, .01f));
}
-NGRAPH_TEST(${BACKEND_NAME}, backwards_atan2)
-{
- auto backend = runtime::Backend::create("${BACKEND_NAME}");
- Shape shape{30};
-
- test::Uniform<float> rng(-5.0f, 5.0f);
- auto y = rng.initialize(backend->create_tensor<float>(shape));
- auto x = rng.initialize(backend->create_tensor<float>(shape));
-
- auto make_graph = [shape]() {
- auto X = make_shared<op::Parameter>(element::f32, shape);
- auto Y = make_shared<op::Parameter>(element::f32, shape);
- return make_shared<Function>(make_shared<op::Atan2>(Y, X), ParameterVector{Y, X});
- };
- EXPECT_TRUE(autodiff_numeric_compare<float>(backend.get(), make_graph, {y, x}, .01f, .01f));
-}
-
NGRAPH_TEST(${BACKEND_NAME}, backwards_broadcast0)
{
auto backend = runtime::Backend::create("${BACKEND_NAME}");
ASSERT_TRUE(check_unary<op::Atan>());
}
-TEST(copy, atan2)
-{
- ASSERT_TRUE(check_binary<op::Atan2>());
-}
-
TEST(copy, broadcast)
{
Shape shape1{1};
#include "ngraph/ngraph.hpp"
#include "ngraph/validation_util.hpp"
+#include "op/atan2.hpp"
#include "util/test_tools.hpp"
using namespace ngraph;
void op_is_Atan2()
{
- op::Atan2 node;
+ op::v0::Atan2 node;
EXPECT_FALSE(node.is_unary_elementwise_arithmetic());
EXPECT_TRUE(node.is_binary_elementwise_arithmetic());
EXPECT_FALSE(node.is_binary_elementwise_comparison());
performance_counter.hpp
dynamic/dynamic_backend.cpp
dynamic/dynamic_backend.hpp
+ op/atan2.cpp
+ op/atan2.hpp
op/avg_pool.cpp
op/avg_pool.hpp
)
# Incorrect dimensions for broadcasting for Add
auto_bcast_binary_elementwise_pdpd_dynamic
-# Unsupported primitive of type: Atan2
-atan2
-
# Unsupported primitive of type: ArgMin
argmin_trivial
argmin_2D_i32
backwards_add_nested
backwards_asin
backwards_atan
-backwards_atan2
backwards_broadcast0
backwards_broadcast1
backwards_concat_vector
#include "ngraph/pass/manager.hpp"
#include "ngraph/serializer.hpp"
#include "ngraph/util.hpp"
+#include "op/atan2.hpp"
#include "opset0_downgrade.hpp"
#include "opset1_downgrade.hpp"
// limitations under the License.
//*****************************************************************************
-#include "ngraph/op/atan2.hpp"
+#include "atan2.hpp"
#include "ngraph/op/add.hpp"
#include "ngraph/op/divide.hpp"
#include "ngraph/op/multiply.hpp"
using namespace std;
using namespace ngraph;
-constexpr NodeTypeInfo op::Atan2::type_info;
+constexpr NodeTypeInfo op::v0::Atan2::type_info;
op::v0::Atan2::Atan2(const Output<Node>& y, const Output<Node>& x, const AutoBroadcastSpec& autob)
: BinaryElementwiseArithmetic(y, x, autob)
#include <memory>
+#include "backend_visibility.hpp"
#include "ngraph/op/util/binary_elementwise_arithmetic.hpp"
namespace ngraph
namespace v0
{
/// \brief Elementwise full arctan operation
- class NGRAPH_API Atan2 : public util::BinaryElementwiseArithmetic
+ class BACKEND_API Atan2 : public util::BinaryElementwiseArithmetic
{
public:
static constexpr NodeTypeInfo type_info{"Atan2", 0};
const OutputVector& deltas) override;
};
}
- using v0::Atan2;
}
}
#pragma once
#include "ngraph/ops.hpp"
+#include "op/atan2.hpp"
#include "op/avg_pool.hpp"
namespace ngraph
NGRAPH_OP(ArgMin, ngraph::op)
NGRAPH_OP(Asin, ngraph::op)
NGRAPH_OP(Atan, ngraph::op)
-NGRAPH_OP(Atan2, ngraph::op)
+NGRAPH_OP(Atan2, ngraph::op::v0)
NGRAPH_OP(AvgPool, ngraph::op::v0)
NGRAPH_OP(BatchMatMul, ngraph::op)
NGRAPH_OP(BatchMatMulTranspose, ngraph::op)
#include "ngraph/graph_util.hpp"
#include "ngraph/ops.hpp"
#include "ngraph/provenance.hpp"
+#include "op/atan2.hpp"
#include "op/avg_pool.hpp"
using namespace std;