1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

fix: supress GCC13 warnings (#24434)

* fix: supress GCC13 warnings

* fix for review and compile-warning on MacOS
This commit is contained in:
Kumataro
2023-10-26 15:00:58 +09:00
committed by GitHub
parent 38bc519e4a
commit 1911c63826
7 changed files with 42 additions and 10 deletions
+5 -4
View File
@@ -149,10 +149,11 @@ void getPoolingKernelParams(const LayerParams &params, std::vector<size_t>& kern
std::vector<size_t>& strides, cv::String &padMode)
{
bool is_global = params.get<bool>("global_pooling", false);
globalPooling.resize(3);
globalPooling[0] = params.get<bool>("global_pooling_d", is_global);
globalPooling[1] = params.get<bool>("global_pooling_h", is_global);
globalPooling[2] = params.get<bool>("global_pooling_w", is_global);
globalPooling.assign({
params.get<bool>("global_pooling_d", is_global),
params.get<bool>("global_pooling_h", is_global),
params.get<bool>("global_pooling_w", is_global)
});
if (globalPooling[0] || globalPooling[1] || globalPooling[2])
{
@@ -260,6 +260,11 @@ const tensorflow::AttrValue& getLayerAttr(const tensorflow::NodeDef &layer, cons
return layer.attr().at(name);
}
#if defined(__GNUC__) && (__GNUC__ == 13)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"
#endif
static DataLayout getDataLayout(const tensorflow::NodeDef& layer)
{
if (hasLayerAttr(layer, "data_format"))
@@ -2978,6 +2983,10 @@ static void addConstNodes(tensorflow::GraphDef& net, std::map<String, int>& cons
CV_LOG_DEBUG(NULL, "DNN/TF: layers_to_ignore.size() = " << layers_to_ignore.size());
}
#if defined(__GNUC__) && (__GNUC__ == 13)
#pragma GCC diagnostic pop
#endif
// If all inputs of specific layer have the same data layout we can say that
// this layer's output has this data layout too. Returns DNN_LAYOUT_UNKNOWN otherwise.
DataLayout TFImporter::predictOutputDataLayout(const tensorflow::NodeDef& layer)