Drop legacy stuff
This commit is contained in:
parent
e23704ef5e
commit
afbf8461ed
@ -2,30 +2,32 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "ngraph/op/select.hpp"
|
#include "openvino/op/select.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "bound_evaluate.hpp"
|
#include "bound_evaluate.hpp"
|
||||||
#include "itt.hpp"
|
#include "itt.hpp"
|
||||||
#include "ngraph/attribute_visitor.hpp"
|
#include "ngraph/validation_util.hpp" // tbr
|
||||||
#include "ngraph/validation_util.hpp"
|
#include "openvino/core/attribute_visitor.hpp"
|
||||||
#include "openvino/reference/select.hpp"
|
#include "openvino/reference/select.hpp"
|
||||||
#include "select_shape_inference.hpp"
|
#include "select_shape_inference.hpp"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace ngraph;
|
using namespace ngraph;
|
||||||
|
|
||||||
op::v1::Select::Select(const Output<Node>& arg0,
|
namespace ov {
|
||||||
const Output<Node>& arg1,
|
namespace op {
|
||||||
const Output<Node>& arg2,
|
namespace v1 {
|
||||||
const AutoBroadcastSpec& auto_broadcast)
|
Select::Select(const Output<Node>& arg0,
|
||||||
|
const Output<Node>& arg1,
|
||||||
|
const Output<Node>& arg2,
|
||||||
|
const AutoBroadcastSpec& auto_broadcast)
|
||||||
: Op({arg0, arg1, arg2}),
|
: Op({arg0, arg1, arg2}),
|
||||||
m_auto_broadcast(auto_broadcast) {
|
m_auto_broadcast(auto_broadcast) {
|
||||||
constructor_validate_and_infer_types();
|
constructor_validate_and_infer_types();
|
||||||
}
|
}
|
||||||
|
|
||||||
void op::v1::Select::validate_and_infer_types() {
|
void Select::validate_and_infer_types() {
|
||||||
OV_OP_SCOPE(v1_Select_validate_and_infer_types);
|
OV_OP_SCOPE(v1_Select_validate_and_infer_types);
|
||||||
// Condition element type check
|
// Condition element type check
|
||||||
NODE_VALIDATION_CHECK(this,
|
NODE_VALIDATION_CHECK(this,
|
||||||
@ -47,13 +49,13 @@ void op::v1::Select::validate_and_infer_types() {
|
|||||||
set_output_type(0, result_et, output_shapes[0]);
|
set_output_type(0, result_et, output_shapes[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr<Node> op::v1::Select::clone_with_new_inputs(const OutputVector& new_args) const {
|
std::shared_ptr<Node> Select::clone_with_new_inputs(const OutputVector& new_args) const {
|
||||||
OV_OP_SCOPE(v1_Select_clone_with_new_inputs);
|
OV_OP_SCOPE(v1_Select_clone_with_new_inputs);
|
||||||
check_new_args_count(this, new_args);
|
check_new_args_count(this, new_args);
|
||||||
return make_shared<v1::Select>(new_args.at(0), new_args.at(1), new_args.at(2), m_auto_broadcast);
|
return std::make_shared<v1::Select>(new_args.at(0), new_args.at(1), new_args.at(2), m_auto_broadcast);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool op::v1::Select::visit_attributes(AttributeVisitor& visitor) {
|
bool Select::visit_attributes(AttributeVisitor& visitor) {
|
||||||
OV_OP_SCOPE(v1_Select_visit_attributes);
|
OV_OP_SCOPE(v1_Select_visit_attributes);
|
||||||
visitor.on_attribute("auto_broadcast", m_auto_broadcast);
|
visitor.on_attribute("auto_broadcast", m_auto_broadcast);
|
||||||
return true;
|
return true;
|
||||||
@ -65,7 +67,7 @@ namespace {
|
|||||||
template <element::Type_t ET>
|
template <element::Type_t ET>
|
||||||
bool evaluate(const HostTensorVector& output_values,
|
bool evaluate(const HostTensorVector& output_values,
|
||||||
const HostTensorVector& input_values,
|
const HostTensorVector& input_values,
|
||||||
const op::AutoBroadcastSpec& autob) {
|
const AutoBroadcastSpec& autob) {
|
||||||
using T = typename element_type_traits<ET>::value_type;
|
using T = typename element_type_traits<ET>::value_type;
|
||||||
|
|
||||||
const auto& in_cond = input_values[0];
|
const auto& in_cond = input_values[0];
|
||||||
@ -74,20 +76,20 @@ bool evaluate(const HostTensorVector& output_values,
|
|||||||
|
|
||||||
const auto& out = output_values[0];
|
const auto& out = output_values[0];
|
||||||
|
|
||||||
ov::reference::select<T>(in_cond->get_data_ptr<char>(),
|
reference::select<T>(in_cond->get_data_ptr<char>(),
|
||||||
in_then->get_data_ptr<T>(),
|
in_then->get_data_ptr<T>(),
|
||||||
in_else->get_data_ptr<T>(),
|
in_else->get_data_ptr<T>(),
|
||||||
out->get_data_ptr<T>(),
|
out->get_data_ptr<T>(),
|
||||||
in_cond->get_shape(),
|
in_cond->get_shape(),
|
||||||
in_then->get_shape(),
|
in_then->get_shape(),
|
||||||
in_else->get_shape(),
|
in_else->get_shape(),
|
||||||
autob);
|
autob);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool evaluate_select(const HostTensorVector& output_values,
|
bool evaluate_select(const HostTensorVector& output_values,
|
||||||
const HostTensorVector& input_values,
|
const HostTensorVector& input_values,
|
||||||
const op::AutoBroadcastSpec& autob,
|
const AutoBroadcastSpec& autob,
|
||||||
const element::Type_t& et) {
|
const element::Type_t& et) {
|
||||||
bool rc = false;
|
bool rc = false;
|
||||||
|
|
||||||
@ -115,7 +117,7 @@ bool evaluate_select(const HostTensorVector& output_values,
|
|||||||
} // namespace
|
} // namespace
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
bool op::v1::Select::evaluate(const HostTensorVector& output_values, const HostTensorVector& input_values) const {
|
bool Select::evaluate(const HostTensorVector& output_values, const HostTensorVector& input_values) const {
|
||||||
OV_OP_SCOPE(v1_Select_evaluate);
|
OV_OP_SCOPE(v1_Select_evaluate);
|
||||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||||
OPENVINO_ASSERT(validate_host_tensor_vector(input_values, 3));
|
OPENVINO_ASSERT(validate_host_tensor_vector(input_values, 3));
|
||||||
@ -125,33 +127,35 @@ bool op::v1::Select::evaluate(const HostTensorVector& output_values, const HostT
|
|||||||
return detail::evaluate_select(output_values, input_values, autob, output_values[0]->get_element_type());
|
return detail::evaluate_select(output_values, input_values, autob, output_values[0]->get_element_type());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool op::v1::Select::evaluate_lower(ov::TensorVector& output_values) const {
|
bool Select::evaluate_lower(TensorVector& output_values) const {
|
||||||
return get_input_tensor(0).has_and_set_bound() && default_lower_bound_evaluator(this, output_values);
|
return get_input_tensor(0).has_and_set_bound() && default_lower_bound_evaluator(this, output_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool op::v1::Select::evaluate_upper(ov::TensorVector& output_values) const {
|
bool Select::evaluate_upper(TensorVector& output_values) const {
|
||||||
return get_input_tensor(0).has_and_set_bound() && default_upper_bound_evaluator(this, output_values);
|
return get_input_tensor(0).has_and_set_bound() && default_upper_bound_evaluator(this, output_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool op::v1::Select::has_evaluate() const {
|
bool Select::has_evaluate() const {
|
||||||
OV_OP_SCOPE(v1_Select_has_evaluate);
|
OV_OP_SCOPE(v1_Select_has_evaluate);
|
||||||
switch (get_output_element_type(0)) {
|
switch (get_output_element_type(0)) {
|
||||||
case ngraph::element::i8:
|
case element::boolean:
|
||||||
case ngraph::element::i16:
|
case element::bf16:
|
||||||
case ngraph::element::i32:
|
case element::f16:
|
||||||
case ngraph::element::i64:
|
case element::f32:
|
||||||
case ngraph::element::u8:
|
case element::f64:
|
||||||
case ngraph::element::u16:
|
case element::i8:
|
||||||
case ngraph::element::u32:
|
case element::i16:
|
||||||
case ngraph::element::u64:
|
case element::i32:
|
||||||
case ngraph::element::bf16:
|
case element::i64:
|
||||||
case ngraph::element::f16:
|
case element::u8:
|
||||||
case ngraph::element::f32:
|
case element::u16:
|
||||||
case ngraph::element::f64:
|
case element::u32:
|
||||||
case ngraph::element::boolean:
|
case element::u64:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
break;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
} // namespace v1
|
||||||
|
} // namespace op
|
||||||
|
} // namespace ov
|
||||||
|
Loading…
Reference in New Issue
Block a user