Files
openvino/ngraph/test/visitors/op/einsum.cpp
T
Roman Kazantsev 5e8d1ccf92 Implement Einsum reference in nGraph interpreter (#5923)
* Implement Einsum reference in nGraph interpreter

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Apply code-style patch and fix build issues

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix CI build

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix fast build and apply code review feedback

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Add visitor API tests, check for input type and reduce memory consumption

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Apply code style

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Add visitor API tests

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-06-04 11:08:30 +03:00

29 lines
898 B
C++

// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "gtest/gtest.h"
#include "ngraph/ngraph.hpp"
#include "ngraph/opsets/opset1.hpp"
#include "ngraph/opsets/opset7.hpp"
#include "util/visitor.hpp"
using namespace std;
using namespace ngraph;
using ngraph::test::NodeBuilder;
using ngraph::test::ValueMap;
TEST(attributes, einsum_v7_op)
{
NodeBuilder::get_ops().register_factory<opset7::Einsum>();
auto input1 = make_shared<opset1::Parameter>(element::i32, Shape{2, 3});
auto input2 = make_shared<opset1::Parameter>(element::i32, Shape{3, 4});
std::string equation = "ab,bc->ac";
auto einsum = make_shared<opset7::Einsum>(OutputVector{input1, input2}, equation);
NodeBuilder builder(einsum);
auto g_einsum = as_type_ptr<opset7::Einsum>(builder.create());
EXPECT_EQ(g_einsum->get_equation(), einsum->get_equation());
}