Changed throw ov::Exception to macro (#16150)

* Changed throw ov::Exception to macro

* Fixed code style

* Revert myriad headers

* CPPlint fixes

* Fixed typo
This commit is contained in:
Ilya Churaev
2023-03-10 11:14:50 +04:00
committed by GitHub
parent ec8a4abf6d
commit 45bdbf7486
61 changed files with 337 additions and 385 deletions

View File

@@ -188,12 +188,8 @@ template <class T>
Output<Node> eltwise_fold(const Output<Node>& input0, const Output<Node>& input1) {
auto eltwise = std::make_shared<T>(input0, input1);
OutputVector output(eltwise->get_output_size());
if (!eltwise->constant_fold(output, {input0, input1})) {
throw ov::Exception("Can not constant fold eltwise node");
}
if (output.size() != 1) {
throw ov::Exception("Eltwise constant fold has unexpected number of outputs: " + std::to_string(output.size()));
}
OPENVINO_ASSERT(eltwise->constant_fold(output, {input0, input1}), "Can not constant fold eltwise node");
OPENVINO_ASSERT(output.size() == 1, "Eltwise constant fold has unexpected number of outputs: ", output.size());
return output[0];
}

View File

@@ -165,7 +165,7 @@ bool convertTensorIteratorToSequence(const std::shared_ptr<ov::opset5::TensorIte
gru_cell->get_clip(),
gru_cell->get_linear_before_reset());
} else {
throw ov::Exception("Unsupported sequence type");
OPENVINO_UNREACHABLE("Unsupported sequence type");
}
ngraph::Output<ngraph::Node> out = sequence->output(0);

View File

@@ -47,7 +47,7 @@ bool get_single_value(const std::shared_ptr<op::v0::Constant>& const_node, float
case element::Type_t::u64:
return util::normalize_single_value(const_node->get_vector<uint64_t>(), value);
default:
throw ov::Exception("Unsupported precision for const operation: " + const_node->get_friendly_name());
OPENVINO_UNREACHABLE("Unsupported precision for const operation: ", const_node->get_friendly_name());
}
}
@@ -125,7 +125,7 @@ std::shared_ptr<ngraph::Node> activation(const std::string& activation_name,
} else if (activation_name == "tanh") {
return std::make_shared<opset4::Tanh>(apply_to);
} else {
throw ov::Exception("Unsupported activation function");
OPENVINO_UNREACHABLE("Unsupported activation function");
}
}

View File

@@ -100,7 +100,7 @@ public:
} else if (new_args.size() == 4) {
return std::make_shared<FakeEye>(new_args[0], new_args[1], new_args[2], new_args[3], ov::element::f32);
} else {
throw ov::Exception("FakeEye has incorrect input number: " + std::to_string(new_args.size()));
OPENVINO_UNREACHABLE("FakeEye has incorrect input number: ", new_args.size());
}
}
};