Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / src / pooling.cpp
index 6006d14..18ecebc 100644 (file)
@@ -30,6 +30,8 @@ primitive_type_id pooling_type_id()
 
 layout pooling_inst::calc_output_layout(parent::typed_node const& node)
 {
+    assert((bool)node.get_primitive()->output_data_type == false
+           && "Output data type forcing is not supported for pooling_node!");
     auto desc = node.get_primitive();
 
     auto input_layout = node.input().get_output_layout();
@@ -50,6 +52,11 @@ layout pooling_inst::calc_output_layout(parent::typed_node const& node)
         CLDNN_ERROR_NOT_PROPER_FORMAT(node.id(), "Input_layout.format", input_layout.format.value, "argmax_layout.format", argmax_layout.format);
     }
 
+    if (desc->global_pooling) {
+        window_size.spatial[0] = input_layout.size.spatial[0];
+        window_size.spatial[1] = input_layout.size.spatial[1]; 
+    }
+
     // TODO: Consider moving general parameter verification to arguments constructor.
     CLDNN_ERROR_LESS_OR_EQUAL_THAN(node.id(), "stride spatial X", stride.spatial[0], "", 0, "Stride spatial X must be positive (>= 1)");
     CLDNN_ERROR_LESS_OR_EQUAL_THAN(node.id(), "stride spatial Y", stride.spatial[1], "", 0, "Stride spatial Y must be positive (>= 1)");