ONE - On-device Neural Engine
Loading...
Searching...
No Matches
OpPrinter.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
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 "OpPrinter.h"
18
19#include <mio_circle/Helper.h>
20
21#include <memory>
22
24
25using std::make_unique;
26
27namespace circledump
28{
29
30// TODO move to some header
31std::ostream &operator<<(std::ostream &os, const std::vector<int32_t> &vect);
32
33// TODO Re-arrange in alphabetical order
34
35class AddPrinter : public OpPrinter
36{
37public:
38 void options(const circle::Operator *op, std::ostream &os) const override
39 {
40 if (auto *params = op->builtin_options_as_AddOptions())
41 {
42 os << " ";
43 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
44 << ") ";
45 os << std::endl;
46 }
47 }
48};
49
51{
52public:
53 void options(const circle::Operator *op, std::ostream &os) const override
54 {
55 if (auto *params = op->builtin_options_as_ArgMaxOptions())
56 {
57 os << " ";
58 os << "OutputType(" << EnumNameTensorType(params->output_type()) << ") ";
59 os << std::endl;
60 }
61 }
62};
63
65{
66public:
67 void options(const circle::Operator *op, std::ostream &os) const override
68 {
69 if (auto *params = op->builtin_options_as_ArgMinOptions())
70 {
71 os << " ";
72 os << "OutputType(" << EnumNameTensorType(params->output_type()) << ") ";
73 os << std::endl;
74 }
75 }
76};
77
79{
80public:
81 void options(const circle::Operator *op, std::ostream &os) const override
82 {
83 if (auto *params = op->builtin_options_as_BatchMatMulOptions())
84 {
85 os << " ";
86 os << std::boolalpha;
87 os << "adjoint_lhs(" << params->adjoint_lhs() << ") ";
88 os << "adjoint_rhs(" << params->adjoint_rhs() << ") ";
89 os << std::noboolalpha;
90 os << std::endl;
91 }
92 }
93};
94
96{
97public:
98 void options(const circle::Operator *op, std::ostream &os) const override
99 {
100 if (auto *params = op->builtin_options_as_BidirectionalSequenceLSTMOptions())
101 {
102 os << " ";
103 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
104 << ") ";
105 os << "cell_clip(" << params->cell_clip() << ") ";
106 os << "proj_clip(" << params->proj_clip() << ") ";
107 os << "time_major(" << params->time_major() << ") ";
108 os << "asymmetric_quantize_inputs(" << params->asymmetric_quantize_inputs() << ") ";
109 os << "merge_outputs(" << params->merge_outputs() << ") ";
110 os << std::endl;
111 }
112 }
113};
114
115class CastPrinter : public OpPrinter
116{
117public:
118 void options(const circle::Operator *op, std::ostream &os) const override
119 {
120 if (auto cast_params = op->builtin_options_as_CastOptions())
121 {
122 os << " ";
123 os << "in_data_type(" << circle::EnumNameTensorType(cast_params->in_data_type()) << ") ";
124 os << "out_data_type(" << circle::EnumNameTensorType(cast_params->out_data_type()) << ") ";
125 os << std::endl;
126 }
127 }
128};
129
131{
132public:
133 void options(const circle::Operator *op, std::ostream &os) const override
134 {
135 if (auto conv_params = op->builtin_options_as_Conv2DOptions())
136 {
137 os << " ";
138 os << "Padding(" << EnumNamePadding(conv_params->padding()) << ") ";
139 os << "Stride.W(" << conv_params->stride_w() << ") ";
140 os << "Stride.H(" << conv_params->stride_h() << ") ";
141 os << "Dilation.W(" << conv_params->dilation_w_factor() << ") ";
142 os << "Dilation.H(" << conv_params->dilation_h_factor() << ") ";
143 os << "Activation("
144 << EnumNameActivationFunctionType(conv_params->fused_activation_function()) << ")";
145 os << std::endl;
146 }
147 }
148};
149
151{
152public:
153 void options(const circle::Operator *op, std::ostream &os) const override
154 {
155 if (auto *std_params = op->builtin_options_as_DepthToSpaceOptions())
156 {
157 os << " ";
158 os << "BlockSize(" << std_params->block_size() << ")";
159 os << std::endl;
160 }
161 }
162};
163
164class DivPrinter : public OpPrinter
165{
166public:
167 void options(const circle::Operator *op, std::ostream &os) const override
168 {
169 if (auto *params = op->builtin_options_as_DivOptions())
170 {
171 os << " ";
172 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
173 << ") ";
174 os << std::endl;
175 }
176 }
177};
178
180{
181public:
182 void options(const circle::Operator *op, std::ostream &os) const override
183 {
184 if (auto pool_params = op->builtin_options_as_Pool2DOptions())
185 {
186 os << " ";
187 os << "Padding(" << EnumNamePadding(pool_params->padding()) << ") ";
188 os << "Stride.W(" << pool_params->stride_w() << ") ";
189 os << "Stride.H(" << pool_params->stride_h() << ") ";
190 os << "Filter.W(" << pool_params->filter_width() << ") ";
191 os << "Filter.H(" << pool_params->filter_height() << ") ";
192 os << "Activation("
193 << EnumNameActivationFunctionType(pool_params->fused_activation_function()) << ")";
194 os << std::endl;
195 }
196 }
197};
198
200{
201public:
202 void options(const circle::Operator *op, std::ostream &os) const override
203 {
204 if (auto *concatenation_params = op->builtin_options_as_ConcatenationOptions())
205 {
206 os << " ";
207 os << "Activation("
208 << EnumNameActivationFunctionType(concatenation_params->fused_activation_function())
209 << ") ";
210 os << "Axis(" << concatenation_params->axis() << ")";
211 os << std::endl;
212 }
213 }
214};
215
217{
218public:
219 void options(const circle::Operator *op, std::ostream &os) const override
220 {
221 if (auto reducer_params = op->builtin_options_as_ReducerOptions())
222 {
223 os << " ";
224 os << "keep_dims(" << reducer_params->keep_dims() << ") ";
225 os << std::endl;
226 }
227 }
228};
229
231{
232public:
233 void options(const circle::Operator *op, std::ostream &os) const override
234 {
235 if (auto *reshape_params = op->builtin_options_as_ReshapeOptions())
236 {
237 auto new_shape = mio::circle::as_index_vector(reshape_params->new_shape());
238 os << " ";
239 os << "NewShape(" << new_shape << ")";
240 os << std::endl;
241 }
242 }
243};
244
246{
247public:
248 void options(const circle::Operator *op, std::ostream &os) const override
249 {
250 if (auto *resize_params = op->builtin_options_as_ResizeBilinearOptions())
251 {
252 os << " ";
253 os << std::boolalpha;
254 os << "align_corners(" << resize_params->align_corners() << ")";
255 os << "half_pixel_centers(" << resize_params->half_pixel_centers() << ")";
256 os << std::noboolalpha;
257 os << std::endl;
258 }
259 }
260};
261
263{
264public:
265 void options(const circle::Operator *op, std::ostream &os) const override
266 {
267 if (auto *resize_params = op->builtin_options_as_ResizeNearestNeighborOptions())
268 {
269 os << " ";
270 os << std::boolalpha;
271 os << "align_corners(" << resize_params->align_corners() << ")";
272 os << std::noboolalpha;
273 os << std::endl;
274 }
275 }
276};
277
279{
280public:
281 void options(const circle::Operator *op, std::ostream &os) const override
282 {
283 if (auto *params = op->builtin_options_as_ReverseSequenceOptions())
284 {
285 os << " ";
286 os << "seq_dim(" << params->seq_dim() << ") ";
287 os << "batch_dim(" << params->batch_dim() << ") ";
288 os << std::endl;
289 }
290 }
291};
292
294{
295public:
296 void options(const circle::Operator *op, std::ostream &os) const override
297 {
298 if (auto conv_params = op->builtin_options_as_DepthwiseConv2DOptions())
299 {
300 os << " ";
301 os << "Padding(" << EnumNamePadding(conv_params->padding()) << ") ";
302 os << "Stride.W(" << conv_params->stride_w() << ") ";
303 os << "Stride.H(" << conv_params->stride_h() << ") ";
304 os << "DepthMultiplier(" << conv_params->depth_multiplier() << ") ";
305 os << "Dilation.W(" << conv_params->dilation_w_factor() << ") ";
306 os << "Dilation.H(" << conv_params->dilation_h_factor() << ") ";
307 os << "Activation("
308 << EnumNameActivationFunctionType(conv_params->fused_activation_function()) << ") ";
309 os << std::endl;
310 }
311 }
312};
313
315{
316public:
317 void options(const circle::Operator *op, std::ostream &os) const override
318 {
319 if (auto *params = op->builtin_options_as_FakeQuantOptions())
320 {
321 os << " ";
322 os << "Min(" << params->min() << ") ";
323 os << "Max(" << params->max() << ") ";
324 os << "NumBits(" << params->num_bits() << ") ";
325 os << std::boolalpha;
326 os << "NarrowRange(" << params->narrow_range() << ") ";
327 os << std::noboolalpha;
328 os << std::endl;
329 }
330 }
331};
332
334{
335public:
336 void options(const circle::Operator *op, std::ostream &os) const override
337 {
338 if (auto *params = op->builtin_options_as_FullyConnectedOptions())
339 {
340 os << " ";
341 os << "WeightFormat(" << EnumNameFullyConnectedOptionsWeightsFormat(params->weights_format())
342 << ") ";
343 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
344 << ") ";
345 os << "keep_num_dims(" << params->keep_num_dims() << ") ";
346
347 os << std::endl;
348 }
349 }
350};
351
353{
354public:
355 void options(const circle::Operator *op, std::ostream &os) const override
356 {
357 if (auto *params = op->builtin_options_as_GatherOptions())
358 {
359 os << " ";
360 os << "Axis(" << params->axis() << ") ";
361
362 os << std::endl;
363 }
364 }
365};
366
367class GeluPrinter : public OpPrinter
368{
369public:
370 void options(const circle::Operator *op, std::ostream &os) const override
371 {
372 if (auto *params = op->builtin_options_as_GeluOptions())
373 {
374 os << " ";
375 os << std::boolalpha;
376 os << "approximate(" << params->approximate() << ") ";
377 os << std::noboolalpha;
378 os << std::endl;
379 }
380 }
381};
382
383class IfPrinter : public OpPrinter
384{
385public:
386 void options(const circle::Operator *op, std::ostream &os) const override
387 {
388 if (auto *params = op->builtin_options_as_IfOptions())
389 {
390 os << " ";
391 os << "then_subgraph_index(" << params->then_subgraph_index() << ") ";
392 os << "else_subgraph_index(" << params->else_subgraph_index() << ") ";
393 os << std::endl;
394 }
395 }
396};
397
399{
400public:
401 void options(const circle::Operator *op, std::ostream &os) const override
402 {
403 if (auto *params = op->builtin_options_as_L2NormOptions())
404 {
405 os << " ";
406 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
407 << ") ";
408 os << std::endl;
409 }
410 }
411};
412
414{
415public:
416 void options(const circle::Operator *op, std::ostream &os) const override
417 {
418 if (auto *params = op->builtin_options_as_LeakyReluOptions())
419 {
420 os << " ";
421 os << "alpha(" << params->alpha() << ") ";
422 }
423 }
424};
425
427{
428public:
429 void options(const circle::Operator *op, std::ostream &os) const override
430 {
431 if (auto *params = op->builtin_options_as_LocalResponseNormalizationOptions())
432 {
433 os << " ";
434 os << "radius(" << params->radius() << ") ";
435 os << "bias(" << params->bias() << ") ";
436 os << "alpha(" << params->alpha() << ") ";
437 os << "beta(" << params->beta() << ") ";
438 os << std::endl;
439 }
440 }
441};
442
444{
445public:
446 void options(const circle::Operator *op, std::ostream &os) const override
447 {
448 if (auto *params = op->builtin_options_as_MirrorPadOptions())
449 {
450 os << " ";
451 os << "mode(" << EnumNameMirrorPadMode(params->mode()) << ") ";
452 os << std::endl;
453 }
454 }
455};
456
457class MulPrinter : public OpPrinter
458{
459public:
460 void options(const circle::Operator *op, std::ostream &os) const override
461 {
462 if (auto *params = op->builtin_options_as_MulOptions())
463 {
464 os << " ";
465 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
466 << ") ";
467 os << std::endl;
468 }
469 }
470};
471
473{
474public:
475 void options(const circle::Operator *op, std::ostream &os) const override
476 {
477 if (auto *params = op->builtin_options_as_OneHotOptions())
478 {
479 os << " ";
480 os << "Axis(" << params->axis() << ") ";
481
482 os << std::endl;
483 }
484 }
485};
486
487class PackPrinter : public OpPrinter
488{
489public:
490 void options(const circle::Operator *op, std::ostream &os) const override
491 {
492 if (auto *params = op->builtin_options_as_PackOptions())
493 {
494 os << " ";
495 os << "ValuesCount(" << params->values_count() << ") ";
496 os << "Axis(" << params->axis() << ") ";
497 os << std::endl;
498 }
499 }
500};
501
503{
504public:
505 void options(const circle::Operator *op, std::ostream &os) const override
506 {
507 if (auto *params = op->builtin_options_as_ShapeOptions())
508 {
509 os << " ";
510 os << "out_type(" << EnumNameTensorType(params->out_type()) << ") ";
511 os << std::endl;
512 }
513 }
514};
515
517{
518public:
519 void options(const circle::Operator *op, std::ostream &os) const override
520 {
521 if (auto *softmax_params = op->builtin_options_as_SoftmaxOptions())
522 {
523 os << " ";
524 os << "Beta(" << softmax_params->beta() << ")";
525 os << std::endl;
526 }
527 }
528};
529
531{
532public:
533 void options(const circle::Operator *op, std::ostream &os) const override
534 {
535 if (auto *std_params = op->builtin_options_as_SpaceToDepthOptions())
536 {
537 os << " ";
538 os << "BlockSize(" << std_params->block_size() << ")";
539 os << std::endl;
540 }
541 }
542};
543
545{
546public:
547 void options(const circle::Operator *op, std::ostream &os) const override
548 {
549 if (auto *std_params = op->builtin_options_as_SparseToDenseOptions())
550 {
551 os << " ";
552 os << "ValidateIndices(" << std_params->validate_indices() << ")";
553 os << std::endl;
554 }
555 }
556};
557
559{
560public:
561 void options(const circle::Operator *op, std::ostream &os) const override
562 {
563 if (auto *params = op->builtin_options_as_SplitOptions())
564 {
565 os << " ";
566 os << "num_splits(" << params->num_splits() << ") ";
567 os << std::endl;
568 }
569 }
570};
571
573{
574public:
575 void options(const circle::Operator *op, std::ostream &os) const override
576 {
577 if (auto *params = op->builtin_options_as_SplitVOptions())
578 {
579 os << " ";
580 os << "num_splits(" << params->num_splits() << ") ";
581 os << std::endl;
582 }
583 }
584};
585
587{
588public:
589 void options(const circle::Operator *op, std::ostream &os) const override
590 {
591 if (auto *params = op->builtin_options_as_SqueezeOptions())
592 {
593 os << " ";
594 os << "SqueezeDims(";
595 for (int i = 0; i < params->squeeze_dims()->size(); ++i)
596 {
597 if (i != 0)
598 os << ", ";
599 os << params->squeeze_dims()->Get(i);
600 }
601 os << ")";
602 os << std::endl;
603 }
604 }
605};
606
608{
609public:
610 void options(const circle::Operator *op, std::ostream &os) const override
611 {
612 if (auto *strided_slice_params = op->builtin_options_as_StridedSliceOptions())
613 {
614 os << " ";
615 os << "begin_mask(" << strided_slice_params->begin_mask() << ") ";
616 os << "end_mask(" << strided_slice_params->end_mask() << ") ";
617 os << "ellipsis_mask(" << strided_slice_params->ellipsis_mask() << ") ";
618 os << "new_axis_mask(" << strided_slice_params->new_axis_mask() << ") ";
619 os << "shrink_axis_mask(" << strided_slice_params->shrink_axis_mask() << ") ";
620 os << std::endl;
621 }
622 }
623};
624
625class SubPrinter : public OpPrinter
626{
627public:
628 void options(const circle::Operator *op, std::ostream &os) const override
629 {
630 if (auto *params = op->builtin_options_as_SubOptions())
631 {
632 os << " ";
633 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
634 << ") ";
635 os << std::endl;
636 }
637 }
638};
639
640class SVDFPrinter : public OpPrinter
641{
642public:
643 void options(const circle::Operator *op, std::ostream &os) const override
644 {
645 if (auto *params = op->builtin_options_as_SVDFOptions())
646 {
647 os << " ";
648 os << "rank(" << params->rank() << ") ";
649 os << "activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
650 << ") ";
651 os << "asymmetric_quantize_inputs(" << params->asymmetric_quantize_inputs() << ") ";
652 os << std::endl;
653 }
654 }
655};
656
658{
659public:
660 void options(const circle::Operator *op, std::ostream &os) const override
661 {
662 if (auto params = op->builtin_options_as_TransposeConvOptions())
663 {
664 os << " ";
665 os << "Padding(" << EnumNamePadding(params->padding()) << ") ";
666 os << "Stride.W(" << params->stride_w() << ") ";
667 os << "Stride.H(" << params->stride_h() << ") ";
668 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
669 << ") ";
670 os << std::endl;
671 }
672 }
673};
674
676{
677public:
678 void options(const circle::Operator *op, std::ostream &os) const override
679 {
680 if (auto *params = op->builtin_options_as_UnidirectionalSequenceLSTMOptions())
681 {
682 os << " ";
683 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
684 << ") ";
685 os << "cell_clip(" << params->cell_clip() << ") ";
686 os << "proj_clip(" << params->proj_clip() << ") ";
687 os << "time_major(" << params->time_major() << ") ";
688 os << "asymmetric_quantize_inputs(" << params->asymmetric_quantize_inputs() << ") ";
689 os << std::endl;
690 }
691 }
692};
693
695{
696public:
697 void options(const circle::Operator *op, std::ostream &os) const override
698 {
699 if (auto *params = op->builtin_options_as_UniqueOptions())
700 {
701 os << " ";
702 os << "idx_out_type(" << EnumNameTensorType(params->idx_out_type()) << ") ";
703 os << std::endl;
704 }
705 }
706};
707
709{
710public:
711 void options(const circle::Operator *op, std::ostream &os) const override
712 {
713 if (auto *params = op->builtin_options_as_WhileOptions())
714 {
715 os << " ";
716 os << "cond_subgraph_index(" << params->cond_subgraph_index() << ") ";
717 os << "body_subgraph_index(" << params->body_subgraph_index() << ") ";
718 os << std::endl;
719 }
720 }
721};
722
724{
725public:
726 void options(const circle::Operator *op, std::ostream &os) const override
727 {
728 if (op->custom_options_format() != circle::CustomOptionsFormat::CustomOptionsFormat_FLEXBUFFERS)
729 {
730 os << " ";
731 os << "Unknown custom option format";
732 return;
733 }
734
735 const flatbuffers::Vector<uint8_t> *option_buf = op->custom_options();
736
737 if (option_buf == nullptr || option_buf->size() == 0)
738 {
739 os << "No attrs found." << std::endl;
740 return;
741 }
742
743 // printing attrs
744 // attrs of custom ops are encoded in flexbuffer format
745 auto attr_map = flexbuffers::GetRoot(option_buf->data(), option_buf->size()).AsMap();
746
747 os << " ";
748 auto keys = attr_map.Keys();
749 for (int i = 0; i < keys.size(); i++)
750 {
751 auto key = keys[i].ToString();
752 os << key << "(" << attr_map[key].ToString() << ") ";
753 }
754
755 // Note: attr in "Shape" type does not seem to be converted by circle_convert.
756 // When the converted circle file (with custom op) is opened with hexa editory,
757 // attrs names can be found but attr name in "Shape" type is not found.
758
759 os << std::endl;
760 }
761};
762
764{
765public:
766 void options(const circle::Operator *op, std::ostream &os) const override
767 {
768 if (auto *params = op->builtin_options_as_BCQFullyConnectedOptions())
769 {
770 os << " ";
771 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
772 << ") ";
773 os << "weights_hidden_size(" << params->weights_hidden_size() << ") ";
774 os << std::endl;
775 }
776 }
777};
778
780{
781public:
782 void options(const circle::Operator *op, std::ostream &os) const override
783 {
784 if (auto *params = op->builtin_options_as_BCQGatherOptions())
785 {
786 os << " ";
787 os << "axis(" << params->axis() << ") ";
788 os << "weights_hidden_size(" << params->input_hidden_size() << ") ";
789 os << std::endl;
790 }
791 }
792};
793
794class GRUPrinter : public OpPrinter
795{
796public:
797 void options(const circle::Operator *op, std::ostream &os) const override
798 {
799 if (auto *params = op->builtin_options_as_GRUOptions())
800 {
801 os << " ";
802 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
803 << ") ";
804 os << "return_sequences(" << params->return_sequences() << ") ";
805 os << "time_major(" << params->time_major() << ") ";
806
807 os << std::endl;
808 }
809 }
810};
811
813{
814public:
815 void options(const circle::Operator *op, std::ostream &os) const override
816 {
817 if (auto *params = op->builtin_options_as_InstanceNormOptions())
818 {
819 os << " ";
820 os << "epsilon(" << params->epsilon() << ") ";
821 os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
822 << ") ";
823 os << std::endl;
824 }
825 }
826};
827
829{
830public:
831 void options(const circle::Operator *op, std::ostream &os) const override
832 {
833 if (auto *params = op->builtin_options_as_RmsNormOptions())
834 {
835 os << " ";
836 os << "epsilon(" << params->epsilon() << ") ";
837 os << std::endl;
838 }
839 }
840};
841
842class RoPEPrinter : public OpPrinter
843{
844public:
845 void options(const circle::Operator *op, std::ostream &os) const override
846 {
847 if (auto *params = op->builtin_options_as_RoPEOptions())
848 {
849 os << " ";
850 os << "mode(" << EnumNameRoPEMode(params->mode()) << ") ";
851 os << std::endl;
852 }
853 }
854};
855
857{
858 _op_map[circle::BuiltinOperator_ADD] = make_unique<AddPrinter>();
859 // There is no Option for ADD_N
860 _op_map[circle::BuiltinOperator_ARG_MAX] = make_unique<ArgMaxPrinter>();
861 _op_map[circle::BuiltinOperator_ARG_MIN] = make_unique<ArgMinPrinter>();
862 _op_map[circle::BuiltinOperator_AVERAGE_POOL_2D] = make_unique<Pool2DPrinter>();
863 _op_map[circle::BuiltinOperator_BATCH_MATMUL] = make_unique<BatchMatMulPrinter>();
864 _op_map[circle::BuiltinOperator_BIDIRECTIONAL_SEQUENCE_LSTM] =
865 make_unique<BidirectionalSequenceLSTMPrinter>();
866 _op_map[circle::BuiltinOperator_CAST] = make_unique<CastPrinter>();
867 // There is no Option for CEIL
868 _op_map[circle::BuiltinOperator_CONCATENATION] = make_unique<ConcatenationPrinter>();
869 _op_map[circle::BuiltinOperator_CONV_2D] = make_unique<Conv2DPrinter>();
870 // There is no Option for DENSIFY
871 _op_map[circle::BuiltinOperator_DEPTH_TO_SPACE] = make_unique<DepthToSpacePrinter>();
872 _op_map[circle::BuiltinOperator_DEPTHWISE_CONV_2D] = make_unique<DepthwiseConv2DPrinter>();
873 // There is no Option for DEQUANTIZE
874 _op_map[circle::BuiltinOperator_DIV] = make_unique<DivPrinter>();
875 _op_map[circle::BuiltinOperator_FAKE_QUANT] = make_unique<FakeQuantPrinter>();
876 // There is no Option for FLOOR
877 // There is no Option for FLOOR_MOD
878 _op_map[circle::BuiltinOperator_FULLY_CONNECTED] = make_unique<FullyConnectedPrinter>();
879 _op_map[circle::BuiltinOperator_GATHER] = make_unique<GatherPrinter>();
880 _op_map[circle::BuiltinOperator_GELU] = make_unique<GeluPrinter>();
881 _op_map[circle::BuiltinOperator_IF] = make_unique<IfPrinter>();
882 _op_map[circle::BuiltinOperator_L2_NORMALIZATION] = make_unique<L2NormPrinter>();
883 _op_map[circle::BuiltinOperator_L2_POOL_2D] = make_unique<Pool2DPrinter>();
884 _op_map[circle::BuiltinOperator_LEAKY_RELU] = make_unique<LeakyReluPrinter>();
885 _op_map[circle::BuiltinOperator_LOCAL_RESPONSE_NORMALIZATION] =
886 make_unique<LocalResponseNormalizationPrinter>();
887 // There is no Option for LOG
888 // There is no Option for LOGISTIC
889 // There is no Option for LOG_SOFTMAX
890 _op_map[circle::BuiltinOperator_MAX_POOL_2D] = make_unique<Pool2DPrinter>();
891 _op_map[circle::BuiltinOperator_MIRROR_PAD] = make_unique<MirrorPadPrinter>();
892 _op_map[circle::BuiltinOperator_MUL] = make_unique<MulPrinter>();
893 // There is no Option for NON_MAX_SUPPRESSION_V4
894 // There is no Option for NON_MAX_SUPPRESSION_V5
895 _op_map[circle::BuiltinOperator_ONE_HOT] = make_unique<OneHotPrinter>();
896 _op_map[circle::BuiltinOperator_PACK] = make_unique<PackPrinter>();
897 // There is no Option for PAD
898 // There is no Option for PADV2
899 // There is no Option for PRELU
900 // There is no Option for RELU
901 // There is no Option for RELU6
902 // There is no Option for RELU_0_TO_1
903 // There is no Option for RELU_N1_TO_1
904 _op_map[circle::BuiltinOperator_REDUCE_ANY] = make_unique<ReducerPrinter>();
905 _op_map[circle::BuiltinOperator_REDUCE_MAX] = make_unique<ReducerPrinter>();
906 _op_map[circle::BuiltinOperator_REDUCE_MIN] = make_unique<ReducerPrinter>();
907 _op_map[circle::BuiltinOperator_REDUCE_PROD] = make_unique<ReducerPrinter>();
908 _op_map[circle::BuiltinOperator_RESHAPE] = make_unique<ReshapePrinter>();
909 _op_map[circle::BuiltinOperator_RESIZE_BILINEAR] = make_unique<ResizeBilinearPrinter>();
910 _op_map[circle::BuiltinOperator_RESIZE_NEAREST_NEIGHBOR] =
911 make_unique<ResizeNearestNeighborPrinter>();
912 _op_map[circle::BuiltinOperator_REVERSE_SEQUENCE] = make_unique<ReverseSequencePrinter>();
913 // There is no Option for ROUND
914 // There is no Option for SELECT
915 // There is no Option for SELECT_V2
916 _op_map[circle::BuiltinOperator_SHAPE] = make_unique<ShapePrinter>();
917 // There is no Option for SIN
918 // There is no Option for SLICE
919 _op_map[circle::BuiltinOperator_SOFTMAX] = make_unique<SoftmaxPrinter>();
920 _op_map[circle::BuiltinOperator_SPACE_TO_DEPTH] = make_unique<SpaceToDepthPrinter>();
921 // There is no Option for SPACE_TO_BATCH_ND
922 _op_map[circle::BuiltinOperator_SPARSE_TO_DENSE] = make_unique<SparseToDensePrinter>();
923 _op_map[circle::BuiltinOperator_SPLIT] = make_unique<SplitPrinter>();
924 _op_map[circle::BuiltinOperator_SPLIT_V] = make_unique<SplitVPrinter>();
925 _op_map[circle::BuiltinOperator_SQUEEZE] = make_unique<SqueezePrinter>();
926 _op_map[circle::BuiltinOperator_STRIDED_SLICE] = make_unique<StridedSlicePrinter>();
927 _op_map[circle::BuiltinOperator_SUB] = make_unique<SubPrinter>();
928 _op_map[circle::BuiltinOperator_SUM] = make_unique<ReducerPrinter>();
929 _op_map[circle::BuiltinOperator_SVDF] = make_unique<SVDFPrinter>();
930 _op_map[circle::BuiltinOperator_TRANSPOSE_CONV] = make_unique<TransposeConvPrinter>();
931 // There is no Option for TOPK_V2
932 _op_map[circle::BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_LSTM] =
933 make_unique<UnidirectionalSequenceLSTMPrinter>();
934 _op_map[circle::BuiltinOperator_UNIQUE] = make_unique<UniquePrinter>();
935 _op_map[circle::BuiltinOperator_WHILE] = make_unique<WhilePrinter>();
936 _op_map[circle::BuiltinOperator_CUSTOM] = make_unique<CustomOpPrinter>();
937
938 // Circle only
939 _op_map[circle::BuiltinOperator_BCQ_FULLY_CONNECTED] = make_unique<BCQFullyConnectedPrinter>();
940 _op_map[circle::BuiltinOperator_BCQ_GATHER] = make_unique<BCQGatherPrinter>();
941 _op_map[circle::BuiltinOperator_GRU] = make_unique<GRUPrinter>();
942 _op_map[circle::BuiltinOperator_INSTANCE_NORM] = make_unique<InstanceNormPrinter>();
943 _op_map[circle::BuiltinOperator_RMS_NORM] = make_unique<RmsNormPrinter>();
944 _op_map[circle::BuiltinOperator_ROPE] = make_unique<RoPEPrinter>();
945}
946
947} // namespace circledump
void options(const circle::Operator *op, std::ostream &os) const override
Definition OpPrinter.cpp:38
void options(const circle::Operator *op, std::ostream &os) const override
Definition OpPrinter.cpp:53
void options(const circle::Operator *op, std::ostream &os) const override
Definition OpPrinter.cpp:67
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
Definition OpPrinter.cpp:81
void options(const circle::Operator *op, std::ostream &os) const override
Definition OpPrinter.cpp:98
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
void options(const circle::Operator *op, std::ostream &os) const override
uoffset_t size() const
const T * data() const
TypedVector Keys() const
std::ostream & operator<<(std::ostream &os, const std::vector< int32_t > &vect)
Definition Dump.cpp:72
Reference GetRoot(const uint8_t *buffer, size_t size)
std::vector< T > as_index_vector(const flatbuffers::Vector< T > *flat_array)
Definition Helper.h:36
int32_t size[5]
Definition Slice.cpp:35