Deprecate nGraph v0 ops and builders (#1856)
[platform/upstream/dldt.git] / ngraph / test / type_prop / quantized_dot.cpp
1 //*****************************************************************************
2 // Copyright 2017-2020 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //*****************************************************************************
16
17 #include "gtest/gtest.h"
18 #include "ngraph/ngraph.hpp"
19 #include "util/type_prop.hpp"
20
21 NGRAPH_SUPPRESS_DEPRECATED_START
22
23 using namespace std;
24 using namespace ngraph;
25
26 TEST(type_prop, quantized_dot_8_bit_output)
27 {
28     element::Type f32 = element::f32;
29     element::Type i8 = element::i8;
30     element::Type u8 = element::u8;
31     element::Type input0_type = u8;
32     element::Type input1_type = i8;
33     element::Type output_type = i8;
34     element::Type scale_type = f32;
35     element::Type input0_zero_point_type = u8;
36     element::Type input1_zero_point_type = i8;
37     element::Type output_zero_point_type = i8;
38     Shape output_shape{64, 72};
39     AxisSet axes{};
40
41     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
42     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
43     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
44     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
45     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
46     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
47     auto quant_dot = make_shared<op::QuantizedDot>(input0,
48                                                    input1,
49                                                    1,
50                                                    scale,
51                                                    input0_zero_point,
52                                                    scale,
53                                                    input1_zero_point,
54                                                    scale,
55                                                    output_zero_point,
56                                                    output_type,
57                                                    axes,
58                                                    axes,
59                                                    axes);
60
61     ASSERT_EQ(quant_dot->get_element_type(), output_type);
62     ASSERT_EQ(quant_dot->get_shape(), output_shape);
63 }
64
65 TEST(type_prop, quantized_dot_32_bit_output)
66 {
67     element::Type f32 = element::f32;
68     element::Type i8 = element::i8;
69     element::Type u8 = element::u8;
70     element::Type i32 = element::i32;
71     element::Type input0_type = u8;
72     element::Type input1_type = i8;
73     element::Type output_type = i32;
74     element::Type scale_type = f32;
75     element::Type input0_zero_point_type = u8;
76     element::Type input1_zero_point_type = i8;
77     element::Type output_zero_point_type = i32;
78     Shape output_shape{64, 72};
79     AxisSet axes{};
80
81     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
82     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
83     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
84     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
85     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
86     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
87     auto quant_dot = make_shared<op::QuantizedDot>(input0,
88                                                    input1,
89                                                    1,
90                                                    scale,
91                                                    input0_zero_point,
92                                                    scale,
93                                                    input1_zero_point,
94                                                    scale,
95                                                    output_zero_point,
96                                                    output_type,
97                                                    axes,
98                                                    axes,
99                                                    axes);
100
101     ASSERT_EQ(quant_dot->get_element_type(), output_type);
102     ASSERT_EQ(quant_dot->get_shape(), output_shape);
103 }
104
105 TEST(type_prop, quantized_dot_non_quantized_input0_fails)
106 {
107     element::Type f32 = element::f32;
108     element::Type i8 = element::i8;
109     element::Type u8 = element::u8;
110     element::Type input0_type = f32;
111     element::Type input1_type = i8;
112     element::Type output_type = i8;
113     element::Type scale_type = f32;
114     element::Type input0_zero_point_type = u8;
115     element::Type input1_zero_point_type = i8;
116     element::Type output_zero_point_type = i8;
117     Shape output_shape{64, 72};
118     AxisSet axes{};
119
120     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
121     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
122     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
123     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
124     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
125     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
126     try
127     {
128         auto quant_dot = make_shared<op::QuantizedDot>(input0,
129                                                        input1,
130                                                        1,
131                                                        scale,
132                                                        input0_zero_point,
133                                                        scale,
134                                                        input1_zero_point,
135                                                        scale,
136                                                        output_zero_point,
137                                                        output_type,
138                                                        axes,
139                                                        axes,
140                                                        axes);
141
142         FAIL() << "Attempt to use non-quantized input0 not detected";
143     }
144     catch (const NodeValidationFailure& error)
145     {
146         EXPECT_HAS_SUBSTRING(error.what(), "Input0 element type (f32) must be a quantized type");
147     }
148     catch (...)
149     {
150         FAIL() << "Deduced type check failed for unexpected reason";
151     }
152 }
153
154 TEST(type_prop, quantized_dot_non_quantized_input1_fails)
155 {
156     element::Type f32 = element::f32;
157     element::Type i8 = element::i8;
158     element::Type u8 = element::u8;
159     element::Type input0_type = u8;
160     element::Type input1_type = f32;
161     element::Type output_type = i8;
162     element::Type scale_type = f32;
163     element::Type input0_zero_point_type = u8;
164     element::Type input1_zero_point_type = i8;
165     element::Type output_zero_point_type = i8;
166     Shape output_shape{64, 72};
167     AxisSet axes{};
168
169     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
170     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
171     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
172     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
173     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
174     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
175     try
176     {
177         auto quant_dot = make_shared<op::QuantizedDot>(input0,
178                                                        input1,
179                                                        1,
180                                                        scale,
181                                                        input0_zero_point,
182                                                        scale,
183                                                        input1_zero_point,
184                                                        scale,
185                                                        output_zero_point,
186                                                        output_type,
187                                                        axes,
188                                                        axes,
189                                                        axes);
190
191         FAIL() << "Attempt to use non-quantized input1 not detected";
192     }
193     catch (const NodeValidationFailure& error)
194     {
195         EXPECT_HAS_SUBSTRING(error.what(), "Input1 element type (f32) must be a quantized type");
196     }
197     catch (...)
198     {
199         FAIL() << "Deduced type check failed for unexpected reason";
200     }
201 }
202
203 TEST(type_prop, quantized_dot_dyn_output_fails)
204 {
205     element::Type f32 = element::f32;
206     element::Type i8 = element::i8;
207     element::Type u8 = element::u8;
208     element::Type input0_type = u8;
209     element::Type input1_type = i8;
210     element::Type output_type = element::dynamic;
211     element::Type scale_type = f32;
212     element::Type input0_zero_point_type = u8;
213     element::Type input1_zero_point_type = i8;
214     element::Type output_zero_point_type = i8;
215     Shape output_shape{64, 72};
216     AxisSet axes{};
217
218     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
219     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
220     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
221     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
222     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
223     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
224     try
225     {
226         auto quant_dot = make_shared<op::QuantizedDot>(input0,
227                                                        input1,
228                                                        1,
229                                                        scale,
230                                                        input0_zero_point,
231                                                        scale,
232                                                        input1_zero_point,
233                                                        scale,
234                                                        output_zero_point,
235                                                        output_type,
236                                                        axes,
237                                                        axes,
238                                                        axes);
239
240         FAIL() << "Attempt to use dynamic output type not detected";
241     }
242     catch (const NodeValidationFailure& error)
243     {
244         EXPECT_HAS_SUBSTRING(error.what(), "Output element type must not be dynamic");
245     }
246     catch (...)
247     {
248         FAIL() << "Deduced type check failed for unexpected reason";
249     }
250 }
251
252 TEST(type_prop, quantized_dot_non_floating_point_scale_fails)
253 {
254     element::Type f32 = element::f32;
255     element::Type i8 = element::i8;
256     element::Type u8 = element::u8;
257     element::Type input0_type = u8;
258     element::Type input1_type = i8;
259     element::Type output_type = i8;
260     element::Type scale_type = i8;
261     element::Type input0_zero_point_type = u8;
262     element::Type input1_zero_point_type = i8;
263     element::Type output_zero_point_type = i8;
264     Shape output_shape{64, 72};
265     AxisSet axes{};
266
267     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
268     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
269     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
270     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
271     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
272     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
273     try
274     {
275         auto quant_dot = make_shared<op::QuantizedDot>(input0,
276                                                        input1,
277                                                        1,
278                                                        scale,
279                                                        input0_zero_point,
280                                                        scale,
281                                                        input1_zero_point,
282                                                        scale,
283                                                        output_zero_point,
284                                                        output_type,
285                                                        axes,
286                                                        axes,
287                                                        axes);
288
289         FAIL() << "Attempt to non floating point scale not detected";
290     }
291     catch (const NodeValidationFailure& error)
292     {
293         EXPECT_HAS_SUBSTRING(error.what(), "Scale must be a floating point number");
294     }
295     catch (...)
296     {
297         FAIL() << "Deduced type check failed for unexpected reason";
298     }
299 }
300
301 TEST(type_prop, quantized_dot_input0_zero_point_type_mismatch_fails)
302 {
303     element::Type f32 = element::f32;
304     element::Type i8 = element::i8;
305     element::Type u8 = element::u8;
306     element::Type input0_type = u8;
307     element::Type input1_type = i8;
308     element::Type output_type = i8;
309     element::Type scale_type = f32;
310     element::Type input0_zero_point_type = i8;
311     element::Type input1_zero_point_type = i8;
312     element::Type output_zero_point_type = i8;
313     Shape output_shape{64, 72};
314     AxisSet axes{};
315
316     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
317     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
318     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
319     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
320     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
321     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
322     try
323     {
324         auto quant_dot = make_shared<op::QuantizedDot>(input0,
325                                                        input1,
326                                                        1,
327                                                        scale,
328                                                        input0_zero_point,
329                                                        scale,
330                                                        input1_zero_point,
331                                                        scale,
332                                                        output_zero_point,
333                                                        output_type,
334                                                        axes,
335                                                        axes,
336                                                        axes);
337
338         FAIL() << "Attempt to use zero point type different from input0 type not detected";
339     }
340     catch (const NodeValidationFailure& error)
341     {
342         EXPECT_HAS_SUBSTRING(
343             error.what(),
344             "Input0 Zero point element type (i8) must match input0 element type (u8)");
345     }
346     catch (...)
347     {
348         FAIL() << "Deduced type check failed for unexpected reason";
349     }
350 }
351
352 TEST(type_prop, quantized_dot_input1_zero_point_type_mismatch_fails)
353 {
354     element::Type f32 = element::f32;
355     element::Type i8 = element::i8;
356     element::Type u8 = element::u8;
357     element::Type input0_type = u8;
358     element::Type input1_type = i8;
359     element::Type output_type = i8;
360     element::Type scale_type = f32;
361     element::Type input0_zero_point_type = u8;
362     element::Type input1_zero_point_type = u8;
363     element::Type output_zero_point_type = i8;
364     Shape output_shape{64, 72};
365     AxisSet axes{};
366
367     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
368     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
369     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
370     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
371     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
372     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
373     try
374     {
375         auto quant_dot = make_shared<op::QuantizedDot>(input0,
376                                                        input1,
377                                                        1,
378                                                        scale,
379                                                        input0_zero_point,
380                                                        scale,
381                                                        input1_zero_point,
382                                                        scale,
383                                                        output_zero_point,
384                                                        output_type,
385                                                        axes,
386                                                        axes,
387                                                        axes);
388
389         FAIL() << "Attempt to use zero point type different from input1 type not detected";
390     }
391     catch (const NodeValidationFailure& error)
392     {
393         EXPECT_HAS_SUBSTRING(
394             error.what(),
395             "Input1 Zero point element type (u8) must match input1 element type (i8)");
396     }
397     catch (...)
398     {
399         FAIL() << "Deduced type check failed for unexpected reason";
400     }
401 }
402
403 TEST(type_prop, quantized_dot_non_scalar_input0_zero_point_fails)
404 {
405     element::Type f32 = element::f32;
406     element::Type i8 = element::i8;
407     element::Type u8 = element::u8;
408     element::Type input0_type = u8;
409     element::Type input1_type = i8;
410     element::Type output_type = i8;
411     element::Type scale_type = f32;
412     element::Type input0_zero_point_type = u8;
413     element::Type input1_zero_point_type = i8;
414     element::Type output_zero_point_type = i8;
415     Shape output_shape{64, 72};
416     AxisSet axes{};
417
418     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
419     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
420     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
421     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{1, 2});
422     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
423     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
424     try
425     {
426         auto quant_dot = make_shared<op::QuantizedDot>(input0,
427                                                        input1,
428                                                        1,
429                                                        scale,
430                                                        input0_zero_point,
431                                                        scale,
432                                                        input1_zero_point,
433                                                        scale,
434                                                        output_zero_point,
435                                                        output_type,
436                                                        axes,
437                                                        axes,
438                                                        axes);
439
440         FAIL() << "Attempt to use non scalar input0 zero point not detected";
441     }
442     catch (const NodeValidationFailure& error)
443     {
444         EXPECT_HAS_SUBSTRING(error.what(),
445                              "Input0 scale and input0 zero point shape must be same and 1");
446     }
447     catch (...)
448     {
449         FAIL() << "Deduced type check failed for unexpected reason";
450     }
451 }
452
453 TEST(type_prop, quantized_dot_non_scalar_input1_zero_point_fails)
454 {
455     element::Type f32 = element::f32;
456     element::Type i8 = element::i8;
457     element::Type u8 = element::u8;
458     element::Type input0_type = u8;
459     element::Type input1_type = i8;
460     element::Type output_type = i8;
461     element::Type scale_type = f32;
462     element::Type input0_zero_point_type = u8;
463     element::Type input1_zero_point_type = i8;
464     element::Type output_zero_point_type = i8;
465     Shape output_shape{64, 72};
466     AxisSet axes{};
467
468     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
469     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
470     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
471     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
472     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{1, 2});
473     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
474     try
475     {
476         auto quant_dot = make_shared<op::QuantizedDot>(input0,
477                                                        input1,
478                                                        1,
479                                                        scale,
480                                                        input0_zero_point,
481                                                        scale,
482                                                        input1_zero_point,
483                                                        scale,
484                                                        output_zero_point,
485                                                        output_type,
486                                                        axes,
487                                                        axes,
488                                                        axes);
489
490         FAIL() << "Attempt to use non scalar input1 zero point not detected";
491     }
492     catch (const NodeValidationFailure& error)
493     {
494         EXPECT_HAS_SUBSTRING(error.what(),
495                              "Input1 scale and input1 zero point shape must be same and 1");
496     }
497     catch (...)
498     {
499         FAIL() << "Deduced type check failed for unexpected reason";
500     }
501 }
502
503 TEST(type_prop, quantized_dot_non_scalar_output_zero_point_fails)
504 {
505     element::Type f32 = element::f32;
506     element::Type i8 = element::i8;
507     element::Type u8 = element::u8;
508     element::Type input0_type = u8;
509     element::Type input1_type = i8;
510     element::Type output_type = i8;
511     element::Type scale_type = f32;
512     element::Type input0_zero_point_type = u8;
513     element::Type input1_zero_point_type = i8;
514     element::Type output_zero_point_type = i8;
515     Shape output_shape{64, 72};
516     AxisSet axes{};
517
518     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
519     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
520     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
521     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
522     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
523     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{1, 2});
524     try
525     {
526         auto quant_dot = make_shared<op::QuantizedDot>(input0,
527                                                        input1,
528                                                        1,
529                                                        scale,
530                                                        input0_zero_point,
531                                                        scale,
532                                                        input1_zero_point,
533                                                        scale,
534                                                        output_zero_point,
535                                                        output_type,
536                                                        axes,
537                                                        axes,
538                                                        axes);
539
540         FAIL() << "Attempt to use non scalar output zero point not detected";
541     }
542     catch (const NodeValidationFailure& error)
543     {
544         EXPECT_HAS_SUBSTRING(error.what(),
545                              "Output scale and output zero point shape must be same and 1");
546     }
547     catch (...)
548     {
549         FAIL() << "Deduced type check failed for unexpected reason";
550     }
551 }
552
553 TEST(type_prop, quantized_dot_non_empty_input0_axes)
554 {
555     element::Type f32 = element::f32;
556     element::Type i8 = element::i8;
557     element::Type u8 = element::u8;
558     element::Type input0_type = u8;
559     element::Type input1_type = i8;
560     element::Type output_type = i8;
561     element::Type scale_type = f32;
562     element::Type input0_zero_point_type = u8;
563     element::Type input1_zero_point_type = i8;
564     element::Type output_zero_point_type = i8;
565     Shape output_shape{64, 72};
566     AxisSet axes{};
567
568     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
569     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
570     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
571     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
572     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
573     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
574     try
575     {
576         auto quant_dot = make_shared<op::QuantizedDot>(input0,
577                                                        input1,
578                                                        1,
579                                                        scale,
580                                                        input0_zero_point,
581                                                        scale,
582                                                        input1_zero_point,
583                                                        scale,
584                                                        output_zero_point,
585                                                        output_type,
586                                                        AxisSet{1},
587                                                        axes,
588                                                        axes);
589
590         FAIL() << "Attempt to use non empty input0 axes not detected";
591     }
592     catch (const NodeValidationFailure& error)
593     {
594         EXPECT_HAS_SUBSTRING(error.what(), "Input0, input1 and output AxisSet should be empty");
595     }
596     catch (...)
597     {
598         FAIL() << "Deduced type check failed for unexpected reason";
599     }
600 }
601
602 TEST(type_prop, quantized_dot_non_empty_input1_axes)
603 {
604     element::Type f32 = element::f32;
605     element::Type i8 = element::i8;
606     element::Type u8 = element::u8;
607     element::Type input0_type = u8;
608     element::Type input1_type = i8;
609     element::Type output_type = i8;
610     element::Type scale_type = f32;
611     element::Type input0_zero_point_type = u8;
612     element::Type input1_zero_point_type = i8;
613     element::Type output_zero_point_type = i8;
614     Shape output_shape{64, 72};
615     AxisSet axes{};
616
617     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
618     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
619     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
620     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
621     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
622     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
623     try
624     {
625         auto quant_dot = make_shared<op::QuantizedDot>(input0,
626                                                        input1,
627                                                        1,
628                                                        scale,
629                                                        input0_zero_point,
630                                                        scale,
631                                                        input1_zero_point,
632                                                        scale,
633                                                        output_zero_point,
634                                                        output_type,
635                                                        axes,
636                                                        AxisSet{1},
637                                                        axes);
638
639         FAIL() << "Attempt to use non empty input1 axes not detected";
640     }
641     catch (const NodeValidationFailure& error)
642     {
643         EXPECT_HAS_SUBSTRING(error.what(), "Input0, input1 and output AxisSet should be empty");
644     }
645     catch (...)
646     {
647         FAIL() << "Deduced type check failed for unexpected reason";
648     }
649 }
650
651 TEST(type_prop, quantized_dot_non_empty_output_axes)
652 {
653     element::Type f32 = element::f32;
654     element::Type i8 = element::i8;
655     element::Type u8 = element::u8;
656     element::Type input0_type = u8;
657     element::Type input1_type = i8;
658     element::Type output_type = i8;
659     element::Type scale_type = f32;
660     element::Type input0_zero_point_type = u8;
661     element::Type input1_zero_point_type = i8;
662     element::Type output_zero_point_type = i8;
663     Shape output_shape{64, 72};
664     AxisSet axes{};
665
666     auto input0 = make_shared<op::Parameter>(input0_type, Shape{64, 3});
667     auto input1 = make_shared<op::Parameter>(input1_type, Shape{3, 72});
668     auto scale = make_shared<op::Parameter>(scale_type, Shape{});
669     auto input0_zero_point = make_shared<op::Parameter>(input0_zero_point_type, Shape{});
670     auto input1_zero_point = make_shared<op::Parameter>(input1_zero_point_type, Shape{});
671     auto output_zero_point = make_shared<op::Parameter>(output_zero_point_type, Shape{});
672     try
673     {
674         auto quant_dot = make_shared<op::QuantizedDot>(input0,
675                                                        input1,
676                                                        1,
677                                                        scale,
678                                                        input0_zero_point,
679                                                        scale,
680                                                        input1_zero_point,
681                                                        scale,
682                                                        output_zero_point,
683                                                        output_type,
684                                                        axes,
685                                                        axes,
686                                                        AxisSet{1});
687
688         FAIL() << "Attempt to use non empty output axes not detected";
689     }
690     catch (const NodeValidationFailure& error)
691     {
692         EXPECT_HAS_SUBSTRING(error.what(), "Input0, input1 and output AxisSet should be empty");
693     }
694     catch (...)
695     {
696         FAIL() << "Deduced type check failed for unexpected reason";
697     }
698 }