From 44de64628ef8aa12f96532e7ea03dbaf1ffc0270 Mon Sep 17 00:00:00 2001 From: DD Date: Tue, 1 Jun 2021 10:36:16 +0800 Subject: [PATCH] add invalid input data check --- ngraph/core/src/op/softplus.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ngraph/core/src/op/softplus.cpp b/ngraph/core/src/op/softplus.cpp index f37008220a4..cfa1aa9a0e2 100644 --- a/ngraph/core/src/op/softplus.cpp +++ b/ngraph/core/src/op/softplus.cpp @@ -29,6 +29,11 @@ bool op::v4::SoftPlus::visit_attributes(AttributeVisitor& visitor) void op::v4::SoftPlus::validate_and_infer_types() { NGRAPH_OP_SCOPE(v4_SoftPlus_validate_and_infer_types); + const element::Type& input_et = get_input_element_type(0); + NODE_VALIDATION_CHECK(this, + input_et.is_real(), + "Input element type must be float. Got: ", + input_et); set_output_size(1); set_output_type(0, get_input_element_type(0), get_input_partial_shape(0)); }