Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / include / ie_layouts.h
index f4c0e4d..740da27 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Intel Corporation
+// Copyright (C) 2018-2019 Intel Corporation
 // SPDX-License-Identifier: Apache-2.0
 //
 
@@ -219,6 +219,9 @@ public:
     void setLayout(Layout l) {
         bool inconsistentLayout = true;
         switch (l) {
+            case Layout::SCALAR:
+                inconsistentLayout = !dims.empty();
+                break;
             case Layout::C:
                 inconsistentLayout = dims.size() != 1;
                 break;
@@ -246,7 +249,7 @@ public:
                 break;
         }
         if (inconsistentLayout)
-            THROW_IE_EXCEPTION << "Dims(" << std::to_string(dims.size()) << ") and format(" << std::to_string(l) << ") are inconsistent.";
+            THROW_IE_EXCEPTION << "Size of dims(" << std::to_string(dims.size()) << ") and format(" << l << ") are inconsistent.";
         layout = l;
     }