Imported Upstream version 1.7.0
[platform/core/ml/nnfw.git] / compiler / circledump / src / OpPrinter.cpp
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 #include "Read.h"
19
20 #include <memory>
21
22 #include <flatbuffers/flexbuffers.h>
23
24 using std::make_unique;
25
26 namespace circledump
27 {
28
29 // TODO move to some header
30 std::ostream &operator<<(std::ostream &os, const std::vector<int32_t> &vect);
31
32 // TODO Re-arrange in alphabetical order
33
34 class AddPrinter : public OpPrinter
35 {
36 public:
37   void options(const circle::Operator *op, std::ostream &os) const override
38   {
39     if (auto *params = op->builtin_options_as_AddOptions())
40     {
41       os << "    ";
42       os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
43          << ") ";
44       os << std::endl;
45     }
46   }
47 };
48
49 class ArgMaxPrinter : public OpPrinter
50 {
51 public:
52   void options(const circle::Operator *op, std::ostream &os) const override
53   {
54     if (auto *params = op->builtin_options_as_ArgMaxOptions())
55     {
56       os << "    ";
57       os << "OutputType(" << EnumNameTensorType(params->output_type()) << ") ";
58       os << std::endl;
59     }
60   }
61 };
62
63 class ArgMinPrinter : public OpPrinter
64 {
65 public:
66   void options(const circle::Operator *op, std::ostream &os) const override
67   {
68     if (auto *params = op->builtin_options_as_ArgMinOptions())
69     {
70       os << "    ";
71       os << "OutputType(" << EnumNameTensorType(params->output_type()) << ") ";
72       os << std::endl;
73     }
74   }
75 };
76
77 class BatchMatMulPrinter : public OpPrinter
78 {
79 public:
80   void options(const circle::Operator *op, std::ostream &os) const override
81   {
82     if (auto *params = op->builtin_options_as_BatchMatMulOptions())
83     {
84       os << "    ";
85       os << std::boolalpha;
86       os << "adjoint_lhs(" << params->adjoint_lhs() << ") ";
87       os << "adjoint_rhs(" << params->adjoint_rhs() << ") ";
88       os << std::endl;
89     }
90   }
91 };
92
93 class CastPrinter : public OpPrinter
94 {
95 public:
96   void options(const circle::Operator *op, std::ostream &os) const override
97   {
98     if (auto cast_params = op->builtin_options_as_CastOptions())
99     {
100       os << "    ";
101       os << "in_data_type(" << circle::EnumNameTensorType(cast_params->in_data_type()) << ") ";
102       os << "out_data_type(" << circle::EnumNameTensorType(cast_params->out_data_type()) << ") ";
103       os << std::endl;
104     }
105   }
106 };
107
108 class Conv2DPrinter : public OpPrinter
109 {
110 public:
111   void options(const circle::Operator *op, std::ostream &os) const override
112   {
113     if (auto conv_params = op->builtin_options_as_Conv2DOptions())
114     {
115       os << "    ";
116       os << "Padding(" << conv_params->padding() << ") ";
117       os << "Stride.W(" << conv_params->stride_w() << ") ";
118       os << "Stride.H(" << conv_params->stride_h() << ") ";
119       os << "Dilation.W(" << conv_params->dilation_w_factor() << ") ";
120       os << "Dilation.H(" << conv_params->dilation_h_factor() << ") ";
121       os << "Activation("
122          << EnumNameActivationFunctionType(conv_params->fused_activation_function()) << ")";
123       os << std::endl;
124     }
125   }
126 };
127
128 class DepthToSpacePrinter : public OpPrinter
129 {
130 public:
131   void options(const circle::Operator *op, std::ostream &os) const override
132   {
133     if (auto *std_params = op->builtin_options_as_DepthToSpaceOptions())
134     {
135       os << "    ";
136       os << "BlockSize(" << std_params->block_size() << ")";
137       os << std::endl;
138     }
139   }
140 };
141
142 class DivPrinter : public OpPrinter
143 {
144 public:
145   void options(const circle::Operator *op, std::ostream &os) const override
146   {
147     if (auto *params = op->builtin_options_as_DivOptions())
148     {
149       os << "    ";
150       os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
151          << ") ";
152       os << std::endl;
153     }
154   }
155 };
156
157 class Pool2DPrinter : public OpPrinter
158 {
159 public:
160   void options(const circle::Operator *op, std::ostream &os) const override
161   {
162     if (auto pool_params = op->builtin_options_as_Pool2DOptions())
163     {
164       os << "    ";
165       os << "Padding(" << pool_params->padding() << ") ";
166       os << "Stride.W(" << pool_params->stride_w() << ") ";
167       os << "Stride.H(" << pool_params->stride_h() << ") ";
168       os << "Filter.W(" << pool_params->filter_width() << ") ";
169       os << "Filter.H(" << pool_params->filter_height() << ") ";
170       os << "Activation("
171          << EnumNameActivationFunctionType(pool_params->fused_activation_function()) << ")";
172       os << std::endl;
173     }
174   }
175 };
176
177 class ConcatenationPrinter : public OpPrinter
178 {
179 public:
180   void options(const circle::Operator *op, std::ostream &os) const override
181   {
182     if (auto *concatenation_params = op->builtin_options_as_ConcatenationOptions())
183     {
184       os << "    ";
185       os << "Activation("
186          << EnumNameActivationFunctionType(concatenation_params->fused_activation_function())
187          << ") ";
188       os << "Axis(" << concatenation_params->axis() << ")";
189       os << std::endl;
190     }
191   }
192 };
193
194 class ReducerPrinter : public OpPrinter
195 {
196 public:
197   void options(const circle::Operator *op, std::ostream &os) const override
198   {
199     if (auto reducer_params = op->builtin_options_as_ReducerOptions())
200     {
201       os << "    ";
202       os << "keep_dims(" << reducer_params->keep_dims() << ") ";
203       os << std::endl;
204     }
205   }
206 };
207
208 class ReshapePrinter : public OpPrinter
209 {
210 public:
211   void options(const circle::Operator *op, std::ostream &os) const override
212   {
213     if (auto *reshape_params = op->builtin_options_as_ReshapeOptions())
214     {
215       auto new_shape = circleread::as_index_vector(reshape_params->new_shape());
216       os << "    ";
217       os << "NewShape(" << new_shape << ")";
218       os << std::endl;
219     }
220   }
221 };
222
223 class ResizeBilinearPrinter : public OpPrinter
224 {
225 public:
226   void options(const circle::Operator *op, std::ostream &os) const override
227   {
228     if (auto *resize_params = op->builtin_options_as_ResizeBilinearOptions())
229     {
230       os << "    ";
231       os << std::boolalpha;
232       os << "align_corners(" << resize_params->align_corners() << ")";
233       os << "half_pixel_centers(" << resize_params->half_pixel_centers() << ")";
234       os << std::endl;
235     }
236   }
237 };
238
239 class ResizeNearestNeighborPrinter : public OpPrinter
240 {
241 public:
242   void options(const circle::Operator *op, std::ostream &os) const override
243   {
244     if (auto *resize_params = op->builtin_options_as_ResizeNearestNeighborOptions())
245     {
246       os << "    ";
247       os << std::boolalpha;
248       os << "align_corners(" << resize_params->align_corners() << ")";
249       os << std::endl;
250     }
251   }
252 };
253
254 class ReverseSequencePrinter : public OpPrinter
255 {
256 public:
257   void options(const circle::Operator *op, std::ostream &os) const override
258   {
259     if (auto *params = op->builtin_options_as_ReverseSequenceOptions())
260     {
261       os << "    ";
262       os << "seq_dim(" << params->seq_dim() << ") ";
263       os << "batch_dim(" << params->batch_dim() << ") ";
264       os << std::endl;
265     }
266   }
267 };
268
269 class DepthwiseConv2DPrinter : public OpPrinter
270 {
271 public:
272   void options(const circle::Operator *op, std::ostream &os) const override
273   {
274     if (auto conv_params = op->builtin_options_as_DepthwiseConv2DOptions())
275     {
276       os << "    ";
277       os << "Padding(" << conv_params->padding() << ") ";
278       os << "Stride.W(" << conv_params->stride_w() << ") ";
279       os << "Stride.H(" << conv_params->stride_h() << ") ";
280       os << "DepthMultiplier(" << conv_params->depth_multiplier() << ") ";
281       os << "Dilation.W(" << conv_params->dilation_w_factor() << ") ";
282       os << "Dilation.H(" << conv_params->dilation_h_factor() << ")";
283       os << "Activation("
284          << EnumNameActivationFunctionType(conv_params->fused_activation_function()) << ") ";
285       os << std::endl;
286     }
287   }
288 };
289
290 class FullyConnectedPrinter : public OpPrinter
291 {
292 public:
293   void options(const circle::Operator *op, std::ostream &os) const override
294   {
295     if (auto *params = op->builtin_options_as_FullyConnectedOptions())
296     {
297       os << "    ";
298       os << "WeightFormat(" << EnumNameFullyConnectedOptionsWeightsFormat(params->weights_format())
299          << ") ";
300       os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
301          << ") ";
302
303       os << std::endl;
304     }
305   }
306 };
307
308 class GatherPrinter : public OpPrinter
309 {
310 public:
311   void options(const circle::Operator *op, std::ostream &os) const override
312   {
313     if (auto *params = op->builtin_options_as_GatherOptions())
314     {
315       os << "    ";
316       os << "Axis(" << params->axis() << ") ";
317
318       os << std::endl;
319     }
320   }
321 };
322
323 class IfPrinter : public OpPrinter
324 {
325 public:
326   void options(const circle::Operator *op, std::ostream &os) const override
327   {
328     if (auto *params = op->builtin_options_as_IfOptions())
329     {
330       os << "    ";
331       os << "then_subgraph_index(" << params->then_subgraph_index() << ") ";
332       os << "else_subgraph_index(" << params->else_subgraph_index() << ") ";
333       os << std::endl;
334     }
335   }
336 };
337
338 class L2NormPrinter : public OpPrinter
339 {
340 public:
341   void options(const circle::Operator *op, std::ostream &os) const override
342   {
343     if (auto *params = op->builtin_options_as_L2NormOptions())
344     {
345       os << "    ";
346       os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
347          << ") ";
348       os << std::endl;
349     }
350   }
351 };
352
353 class LeakyReluPrinter : public OpPrinter
354 {
355 public:
356   void options(const circle::Operator *op, std::ostream &os) const override
357   {
358     if (auto *params = op->builtin_options_as_LeakyReluOptions())
359     {
360       os << "    ";
361       os << "alpha(" << params->alpha() << ") ";
362     }
363   }
364 };
365
366 class LocalResponseNormalizationPrinter : public OpPrinter
367 {
368 public:
369   void options(const circle::Operator *op, std::ostream &os) const override
370   {
371     if (auto *params = op->builtin_options_as_LocalResponseNormalizationOptions())
372     {
373       os << "    ";
374       os << "radius(" << params->radius() << ") ";
375       os << "bias(" << params->bias() << ") ";
376       os << "alpha(" << params->alpha() << ") ";
377       os << "beta(" << params->beta() << ") ";
378       os << std::endl;
379     }
380   }
381 };
382
383 class MirrorPadPrinter : public OpPrinter
384 {
385 public:
386   void options(const circle::Operator *op, std::ostream &os) const override
387   {
388     if (auto *params = op->builtin_options_as_MirrorPadOptions())
389     {
390       os << "    ";
391       os << "mode(" << EnumNameMirrorPadMode(params->mode()) << ") ";
392       os << std::endl;
393     }
394   }
395 };
396
397 class MulPrinter : public OpPrinter
398 {
399 public:
400   void options(const circle::Operator *op, std::ostream &os) const override
401   {
402     if (auto *params = op->builtin_options_as_MulOptions())
403     {
404       os << "    ";
405       os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
406          << ") ";
407       os << std::endl;
408     }
409   }
410 };
411
412 class OneHotPrinter : public OpPrinter
413 {
414 public:
415   void options(const circle::Operator *op, std::ostream &os) const override
416   {
417     if (auto *params = op->builtin_options_as_OneHotOptions())
418     {
419       os << "    ";
420       os << "Axis(" << params->axis() << ") ";
421
422       os << std::endl;
423     }
424   }
425 };
426
427 class PackPrinter : public OpPrinter
428 {
429 public:
430   void options(const circle::Operator *op, std::ostream &os) const override
431   {
432     if (auto *params = op->builtin_options_as_PackOptions())
433     {
434       os << "    ";
435       os << "ValuesCount(" << params->values_count() << ") ";
436       os << "Axis(" << params->axis() << ") ";
437       os << std::endl;
438     }
439   }
440 };
441
442 class ShapePrinter : public OpPrinter
443 {
444 public:
445   void options(const circle::Operator *op, std::ostream &os) const override
446   {
447     if (auto *params = op->builtin_options_as_ShapeOptions())
448     {
449       os << "    ";
450       os << "out_type(" << EnumNameTensorType(params->out_type()) << ") ";
451       os << std::endl;
452     }
453   }
454 };
455
456 class SoftmaxPrinter : public OpPrinter
457 {
458 public:
459   void options(const circle::Operator *op, std::ostream &os) const override
460   {
461     if (auto *softmax_params = op->builtin_options_as_SoftmaxOptions())
462     {
463       os << "    ";
464       os << "Beta(" << softmax_params->beta() << ")";
465       os << std::endl;
466     }
467   }
468 };
469
470 class SpaceToDepthPrinter : public OpPrinter
471 {
472 public:
473   void options(const circle::Operator *op, std::ostream &os) const override
474   {
475     if (auto *std_params = op->builtin_options_as_SpaceToDepthOptions())
476     {
477       os << "    ";
478       os << "BlockSize(" << std_params->block_size() << ")";
479       os << std::endl;
480     }
481   }
482 };
483
484 class SparseToDensePrinter : public OpPrinter
485 {
486 public:
487   void options(const circle::Operator *op, std::ostream &os) const override
488   {
489     if (auto *std_params = op->builtin_options_as_SparseToDenseOptions())
490     {
491       os << "    ";
492       os << "ValidateIndices(" << std_params->validate_indices() << ")";
493       os << std::endl;
494     }
495   }
496 };
497
498 class SplitPrinter : public OpPrinter
499 {
500 public:
501   void options(const circle::Operator *op, std::ostream &os) const override
502   {
503     if (auto *params = op->builtin_options_as_SplitOptions())
504     {
505       os << "    ";
506       os << "num_splits(" << params->num_splits() << ") ";
507       os << std::endl;
508     }
509   }
510 };
511
512 class SplitVPrinter : public OpPrinter
513 {
514 public:
515   void options(const circle::Operator *op, std::ostream &os) const override
516   {
517     if (auto *params = op->builtin_options_as_SplitVOptions())
518     {
519       os << "    ";
520       os << "num_splits(" << params->num_splits() << ") ";
521       os << std::endl;
522     }
523   }
524 };
525
526 class SqueezePrinter : public OpPrinter
527 {
528 public:
529   void options(const circle::Operator *op, std::ostream &os) const override
530   {
531     if (auto *params = op->builtin_options_as_SqueezeOptions())
532     {
533       os << "    ";
534       os << "SqueezeDims(";
535       for (int i = 0; i < params->squeeze_dims()->size(); ++i)
536       {
537         if (i != 0)
538           os << ", ";
539         os << params->squeeze_dims()->Get(i);
540       }
541       os << ")";
542       os << std::endl;
543     }
544   }
545 };
546
547 class StridedSlicePrinter : public OpPrinter
548 {
549 public:
550   void options(const circle::Operator *op, std::ostream &os) const override
551   {
552     if (auto *strided_slice_params = op->builtin_options_as_StridedSliceOptions())
553     {
554       os << "    ";
555       os << "begin_mask(" << strided_slice_params->begin_mask() << ") ";
556       os << "end_mask(" << strided_slice_params->end_mask() << ") ";
557       os << "ellipsis_mask(" << strided_slice_params->ellipsis_mask() << ") ";
558       os << "new_axis_mask(" << strided_slice_params->new_axis_mask() << ") ";
559       os << "shrink_axis_mask(" << strided_slice_params->shrink_axis_mask() << ") ";
560       os << std::endl;
561     }
562   }
563 };
564
565 class SubPrinter : public OpPrinter
566 {
567 public:
568   void options(const circle::Operator *op, std::ostream &os) const override
569   {
570     if (auto *params = op->builtin_options_as_SubOptions())
571     {
572       os << "    ";
573       os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
574          << ") ";
575       os << std::endl;
576     }
577   }
578 };
579
580 class TransposeConvPrinter : public OpPrinter
581 {
582 public:
583   void options(const circle::Operator *op, std::ostream &os) const override
584   {
585     if (auto conv_params = op->builtin_options_as_TransposeConvOptions())
586     {
587       os << "    ";
588       os << "Padding(" << conv_params->padding() << ") ";
589       os << "Stride.W(" << conv_params->stride_w() << ") ";
590       os << "Stride.H(" << conv_params->stride_h() << ") ";
591       os << std::endl;
592     }
593   }
594 };
595
596 class WhilePrinter : public OpPrinter
597 {
598 public:
599   void options(const circle::Operator *op, std::ostream &os) const override
600   {
601     if (auto *params = op->builtin_options_as_WhileOptions())
602     {
603       os << "    ";
604       os << "cond_subgraph_index(" << params->cond_subgraph_index() << ") ";
605       os << "body_subgraph_index(" << params->body_subgraph_index() << ") ";
606       os << std::endl;
607     }
608   }
609 };
610
611 class CustomOpPrinter : public OpPrinter
612 {
613 public:
614   void options(const circle::Operator *op, std::ostream &os) const override
615   {
616     if (op->custom_options_format() != circle::CustomOptionsFormat::CustomOptionsFormat_FLEXBUFFERS)
617     {
618       os << "    ";
619       os << "Unknown custom option format";
620       return;
621     }
622
623     const flatbuffers::Vector<uint8_t> *option_buf = op->custom_options();
624
625     if (option_buf == nullptr || option_buf->size() == 0)
626     {
627       os << "No attrs found." << std::endl;
628       return;
629     }
630
631     // printing attrs
632     // attrs of custom ops are encoded in flexbuffer format
633     auto attr_map = flexbuffers::GetRoot(option_buf->data(), option_buf->size()).AsMap();
634
635     os << "    ";
636     auto keys = attr_map.Keys();
637     for (int i = 0; i < keys.size(); i++)
638     {
639       auto key = keys[i].ToString();
640       os << key << "(" << attr_map[key].ToString() << ") ";
641     }
642
643     // Note: attr in "Shape" type does not seem to be converted by circle_convert.
644     // When the converted circle file (with custom op) is opened with hexa editory,
645     // attrs names can be found but attr name in "Shape" type is not found.
646
647     os << std::endl;
648   }
649 };
650
651 class BCQFullyConnectedPrinter : public OpPrinter
652 {
653 public:
654   void options(const circle::Operator *op, std::ostream &os) const override
655   {
656     if (auto *params = op->builtin_options_as_BCQFullyConnectedOptions())
657     {
658       os << "    ";
659       os << "Activation(" << EnumNameActivationFunctionType(params->fused_activation_function())
660          << ") ";
661       os << "weights_hidden_size(" << params->weights_hidden_size() << ") ";
662       os << std::endl;
663     }
664   }
665 };
666
667 class BCQGatherPrinter : public OpPrinter
668 {
669 public:
670   void options(const circle::Operator *op, std::ostream &os) const override
671   {
672     if (auto *params = op->builtin_options_as_BCQGatherOptions())
673     {
674       os << "    ";
675       os << "axis(" << params->axis() << ") ";
676       os << "weights_hidden_size(" << params->input_hidden_size() << ") ";
677       os << std::endl;
678     }
679   }
680 };
681
682 OpPrinterRegistry::OpPrinterRegistry()
683 {
684   _op_map[circle::BuiltinOperator_ADD] = make_unique<AddPrinter>();
685   // There is no Option for ADD_N
686   _op_map[circle::BuiltinOperator_ARG_MAX] = make_unique<ArgMaxPrinter>();
687   _op_map[circle::BuiltinOperator_ARG_MIN] = make_unique<ArgMinPrinter>();
688   _op_map[circle::BuiltinOperator_AVERAGE_POOL_2D] = make_unique<Pool2DPrinter>();
689   _op_map[circle::BuiltinOperator_BATCH_MATMUL] = make_unique<BatchMatMulPrinter>();
690   _op_map[circle::BuiltinOperator_CAST] = make_unique<CastPrinter>();
691   // There is no Option for CEIL
692   _op_map[circle::BuiltinOperator_CONCATENATION] = make_unique<ConcatenationPrinter>();
693   _op_map[circle::BuiltinOperator_CONV_2D] = make_unique<Conv2DPrinter>();
694   _op_map[circle::BuiltinOperator_DEPTH_TO_SPACE] = make_unique<DepthToSpacePrinter>();
695   _op_map[circle::BuiltinOperator_DEPTHWISE_CONV_2D] = make_unique<DepthwiseConv2DPrinter>();
696   _op_map[circle::BuiltinOperator_DIV] = make_unique<DivPrinter>();
697   // There is no Option for FLOOR
698   // There is no Option for FLOOR_MOD
699   _op_map[circle::BuiltinOperator_FULLY_CONNECTED] = make_unique<FullyConnectedPrinter>();
700   _op_map[circle::BuiltinOperator_GATHER] = make_unique<GatherPrinter>();
701   _op_map[circle::BuiltinOperator_IF] = make_unique<IfPrinter>();
702   _op_map[circle::BuiltinOperator_L2_NORMALIZATION] = make_unique<L2NormPrinter>();
703   _op_map[circle::BuiltinOperator_L2_POOL_2D] = make_unique<Pool2DPrinter>();
704   _op_map[circle::BuiltinOperator_LEAKY_RELU] = make_unique<LeakyReluPrinter>();
705   _op_map[circle::BuiltinOperator_LOCAL_RESPONSE_NORMALIZATION] =
706       make_unique<LocalResponseNormalizationPrinter>();
707   // There is no Option for LOG
708   // There is no Option for LOGISTIC
709   // There is no Option for LOG_SOFTMAX
710   _op_map[circle::BuiltinOperator_MAX_POOL_2D] = make_unique<Pool2DPrinter>();
711   _op_map[circle::BuiltinOperator_MIRROR_PAD] = make_unique<MirrorPadPrinter>();
712   _op_map[circle::BuiltinOperator_MUL] = make_unique<MulPrinter>();
713   _op_map[circle::BuiltinOperator_ONE_HOT] = make_unique<OneHotPrinter>();
714   _op_map[circle::BuiltinOperator_PACK] = make_unique<PackPrinter>();
715   // There is no Option for PAD
716   // There is no Option for PRELU
717   // There is no Option for RELU
718   // There is no Option for RELU6
719   // There is no Option for RELU_N1_TO_1
720   _op_map[circle::BuiltinOperator_REDUCE_ANY] = make_unique<ReducerPrinter>();
721   _op_map[circle::BuiltinOperator_REDUCE_MAX] = make_unique<ReducerPrinter>();
722   _op_map[circle::BuiltinOperator_REDUCE_MIN] = make_unique<ReducerPrinter>();
723   _op_map[circle::BuiltinOperator_REDUCE_PROD] = make_unique<ReducerPrinter>();
724   _op_map[circle::BuiltinOperator_RESHAPE] = make_unique<ReshapePrinter>();
725   _op_map[circle::BuiltinOperator_RESIZE_BILINEAR] = make_unique<ResizeBilinearPrinter>();
726   _op_map[circle::BuiltinOperator_RESIZE_NEAREST_NEIGHBOR] =
727       make_unique<ResizeNearestNeighborPrinter>();
728   _op_map[circle::BuiltinOperator_REVERSE_SEQUENCE] = make_unique<ReverseSequencePrinter>();
729   // There is no Option for ROUND
730   // There is no Option for SELECT
731   // There is no Option for SELECT_V2
732   _op_map[circle::BuiltinOperator_SHAPE] = make_unique<ShapePrinter>();
733   // There is no Option for SIN
734   // There is no Option for SLICE
735   _op_map[circle::BuiltinOperator_SOFTMAX] = make_unique<SoftmaxPrinter>();
736   _op_map[circle::BuiltinOperator_SPACE_TO_DEPTH] = make_unique<SpaceToDepthPrinter>();
737   // There is no Option for SPACE_TO_BATCH_ND
738   _op_map[circle::BuiltinOperator_SPARSE_TO_DENSE] = make_unique<SparseToDensePrinter>();
739   _op_map[circle::BuiltinOperator_SPLIT] = make_unique<SplitPrinter>();
740   _op_map[circle::BuiltinOperator_SPLIT_V] = make_unique<SplitVPrinter>();
741   _op_map[circle::BuiltinOperator_SQUEEZE] = make_unique<SqueezePrinter>();
742   _op_map[circle::BuiltinOperator_STRIDED_SLICE] = make_unique<StridedSlicePrinter>();
743   _op_map[circle::BuiltinOperator_SUB] = make_unique<SubPrinter>();
744   _op_map[circle::BuiltinOperator_SUM] = make_unique<ReducerPrinter>();
745   _op_map[circle::BuiltinOperator_TRANSPOSE_CONV] = make_unique<TransposeConvPrinter>();
746   // There is no Option for TOPK_V2
747   _op_map[circle::BuiltinOperator_WHILE] = make_unique<WhilePrinter>();
748   _op_map[circle::BuiltinOperator_CUSTOM] = make_unique<CustomOpPrinter>();
749
750   // Circle only
751   _op_map[circle::BuiltinOperator_BCQ_FULLY_CONNECTED] = make_unique<BCQFullyConnectedPrinter>();
752   _op_map[circle::BuiltinOperator_BCQ_GATHER] = make_unique<BCQGatherPrinter>();
753 }
754
755 } // namespace circledump