[Coverity] fix uninitialized scalar field (#18751)

* fix Uninitialized scalar variable

* fix CVS-116194

* a few fix

* fix Uninitialized scalar variable

* fix CVS-116194

* a few fix

* rm dead code
This commit is contained in:
Andrei Gorbachev
2023-07-25 10:57:28 +04:00
committed by GitHub
parent 393b3b1545
commit 02ebdcbb8f
9 changed files with 10 additions and 28 deletions
@@ -73,7 +73,7 @@ struct gather_elements : public primitive_base<gather_elements> {
void load(BinaryInputBuffer& ib) override {
primitive_base<gather_elements>::load(ib);
format::type tmp_type;
format::type tmp_type = format::type::any;
ib >> make_data(&tmp_type, sizeof(format::type));
output_format = format(tmp_type);
ib >> output_shape;
@@ -81,7 +81,7 @@ struct random_uniform : public primitive_base<random_uniform> {
ib >> *const_cast<uint64_t*>(&global_seed);
ib >> *const_cast<uint64_t*>(&op_seed);
ib >> *const_cast<tensor*>(&output_shape);
format::type tmp_type;
format::type tmp_type = format::type::any;
ib >> make_data(&tmp_type, sizeof(format::type));
*const_cast<format*>(&output_format) = format(tmp_type);
}
@@ -52,8 +52,8 @@ struct activation_impl : public typed_primitive_impl<activation> {
using parent = typed_primitive_impl<activation>;
using parent::parent;
activation_func activation_function;
activation_additional_params additional_params;
activation_func activation_function = activation_func::none;
activation_additional_params additional_params = {0.f, 0.f};
std::shared_ptr<ov::op::Op> op;
@@ -17,7 +17,7 @@ struct concatenation_impl : public typed_primitive_impl<concatenation> {
using parent = typed_primitive_impl<concatenation>;
using parent::parent;
int64_t axis;
int64_t axis = 0;
std::shared_ptr<ov::op::v0::Concat> op;
@@ -39,7 +39,7 @@ struct eltwise_impl : public typed_primitive_impl<eltwise> {
using parent = typed_primitive_impl<eltwise>;
using parent::parent;
eltwise_mode mode;
eltwise_mode mode = eltwise_mode::sum;
std::vector<float> coefficients;
std::shared_ptr<ov::op::Op> op;
@@ -17,8 +17,8 @@ struct gather_impl : public typed_primitive_impl<gather> {
using parent = typed_primitive_impl<gather>;
using parent::parent;
int64_t axis;
int64_t batch_dims;
int64_t axis = 0;
int64_t batch_dims = 0;
std::shared_ptr<ov::op::v8::Gather> op;
@@ -17,7 +17,7 @@ struct scatter_update_impl : public typed_primitive_impl<scatter_update> {
using parent = typed_primitive_impl<scatter_update>;
using parent::parent;
int64_t axis;
int64_t axis = 0;
std::shared_ptr<ov::op::v3::ScatterUpdate> op;
@@ -1204,22 +1204,7 @@ format layout_optimizer::get_expected_format(quantize_node const& node) {
} else if (layout.is_static() && layout.format.spatial_num() == 2 &&
(layout.data_type == data_types::i8 || layout.data_type == data_types::u8) &&
layout.batch() % 16 == 0) {
if (use_onednn_impls && layout.batch() % 32 == 0) {
if (node.get_users().size() == 1 && node.get_users().front()->is_type<convolution>()) {
auto& conv = node.get_users().front()->as<convolution>();
auto ws = conv.get_input_layout(1).get_tensor();
if (ws.spatial[0] != 7 || conv.get_primitive()->groups > 1 || layout.feature() == 1)
expected = format::bfyx;
else
expected = format::bs_fs_yx_bsv16_fsv4;
auto conv_output_layout = conv.get_output_layout();
auto weights_layout = conv.weights().get_output_layout().convert_to_weights_layout(conv.get_primitive()->grouped_weights_shape);
format expected_conv_fmt = get_expected_format(conv);
if (expected == format::bfyx && expected_conv_fmt == format::bs_fs_yx_bsv32_fsv32 && layout.feature() % 32 == 0)
expected = expected_conv_fmt;
}
} else if (layout.feature() > 8) {
if (layout.feature() > 8) {
expected = format::b_fs_yx_fsv16;
} else {
expected = format::b_fs_yx_fsv4;
@@ -258,9 +258,6 @@ void InferRequestLegacy::SetBlob(const std::string& name, const Blob::Ptr& data)
if (is_remote) {
_deviceInputs[name] = data;
_inputs[name] = data;
} else {
if (is_remote)
_inputs[name] = data;
}
if (!is_remote) {