2 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include "OperationDumper.h"
21 #include "util/logging.h"
28 using namespace operation;
30 OperationDumper::OperationDumper(const std::string &start_msg)
32 VERBOSE(LIR) << start_msg << std::endl;
35 void OperationDumper::visit(const Abs &node)
37 VERBOSE(LIR) << "* Abs" << std::endl;
38 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Abs::Input::INPUT) << ")"
40 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
43 void OperationDumper::visit(const Add &node)
45 VERBOSE(LIR) << "* Add" << std::endl;
46 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Add::Input::LHS) << ", "
47 << node.getInputs().at(Add::Input::RHS) << ")" << std::endl;
48 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
51 void OperationDumper::visit(const ArgMax &node)
53 VERBOSE(LIR) << "* ArgMax" << std::endl;
54 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(ArgMax::Input::INPUT) << ")"
56 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
59 void OperationDumper::visit(const AvgPool2D &node)
61 VERBOSE(LIR) << "* AvgPool2D(Implicit)" << std::endl;
62 VERBOSE(LIR) << " - Inputs : IFM(" << node.getInputs().at(AvgPool2D::Input::INPUT) << ")"
64 VERBOSE(LIR) << " - Output : OFM(" << node.getOutputs().at(0) << ")" << std::endl;
67 void OperationDumper::visit(const BatchToSpaceND &node)
69 VERBOSE(LIR) << "* BatchToSpaceND" << std::endl;
70 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(BatchToSpaceND::Input::INPUT) << ")"
71 << " BlockSize(" << node.getInputs().at(BatchToSpaceND::Input::BLOCK_SIZE) << ")"
73 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
76 void OperationDumper::visit(const operation::BroadcastTo &node)
78 VERBOSE(LIR) << "* BroadcastTo" << std::endl;
79 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(BroadcastTo::Input::INPUT) << ", "
80 << node.getInputs().at(BroadcastTo::Input::SHAPE) << ")" << std::endl;
81 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
84 void OperationDumper::visit(const Cast &node)
86 VERBOSE(LIR) << "* Cast" << std::endl;
87 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Cast::Input::INPUT) << ")"
89 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
92 void OperationDumper::visit(const Comparison &node)
94 VERBOSE(LIR) << "* Comparison" << std::endl;
95 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Comparison::Input::INPUT0) << ", "
96 << node.getInputs().at(Comparison::Input::INPUT1) << ")" << std::endl;
97 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
100 void OperationDumper::visit(const Concat &node)
102 VERBOSE(LIR) << "* Concat" << std::endl;
104 for (auto i : node.getInputs())
106 inputs += std::to_string(i.value()) + ",";
108 VERBOSE(LIR) << " - Inputs : IFM(" << inputs << ")" << std::endl;
109 VERBOSE(LIR) << " - Output : OFM(" << node.getOutputs().at(0) << ")" << std::endl;
112 void OperationDumper::visit(const Conv2D &node)
114 std::string padding_type =
115 node.param().padding.type == PaddingType::EXPLICIT ? "Explicit" : "Implicit";
116 VERBOSE(LIR) << "* Conv2D(" << padding_type << ")" << std::endl;
117 VERBOSE(LIR) << " - Inputs : IFM(" << node.getInputs().at(Conv2D::Input::INPUT) << ") Kernel("
118 << node.getInputs().at(Conv2D::Input::KERNEL) << ") Bias("
119 << node.getInputs().at(Conv2D::Input::BIAS) << ")" << std::endl;
120 VERBOSE(LIR) << " - Output : OFM(" << node.getOutputs().at(0) << ")" << std::endl;
123 void OperationDumper::visit(const ConvertFp16ToFp32 &node)
125 VERBOSE(LIR) << "* ConvertFp16ToFp32" << std::endl;
126 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(ConvertFp16ToFp32::Input::INPUT)
128 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
131 void OperationDumper::visit(const ConvertFp32ToFp16 &node)
133 VERBOSE(LIR) << "* ConvertFp32ToFp16" << std::endl;
134 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(ConvertFp32ToFp16::Input::INPUT)
136 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
139 void OperationDumper::visit(const Cos &node)
141 VERBOSE(LIR) << "* Cos" << std::endl;
142 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Cos::Input::INPUT) << ")"
144 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
147 void OperationDumper::visit(const DepthToSpace &node)
149 VERBOSE(LIR) << "* DepthToSpace" << std::endl;
150 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(DepthToSpace::Input::INPUT) << ")"
152 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
155 void OperationDumper::visit(const DepthwiseConv2D &node)
157 std::string padding_type =
158 node.param().padding.type == PaddingType::EXPLICIT ? "Explicit" : "Implicit";
159 VERBOSE(LIR) << "* DepthwiseConv2D(" << padding_type << ")" << std::endl;
160 VERBOSE(LIR) << " - Inputs : IFM(" << node.getInputs().at(DepthwiseConv2D::Input::INPUT)
161 << ") Kernel(" << node.getInputs().at(DepthwiseConv2D::Input::KERNEL) << ") Bias("
162 << node.getInputs().at(DepthwiseConv2D::Input::BIAS) << ")" << std::endl;
163 VERBOSE(LIR) << " - Output : OFM(" << node.getOutputs().at(0) << ")" << std::endl;
166 void OperationDumper::visit(const Dequantize &node)
168 VERBOSE(LIR) << "* Dequantize" << std::endl;
169 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Dequantize::Input::INPUT) << ")"
171 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
174 void OperationDumper::visit(const Div &node)
176 VERBOSE(LIR) << "* Div" << std::endl;
177 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Div::Input::LHS) << ", "
178 << node.getInputs().at(Div::Input::RHS) << ")" << std::endl;
179 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
182 void OperationDumper::visit(const EmbeddingLookup &node)
184 VERBOSE(LIR) << "* EmbeddingLookup" << std::endl;
185 VERBOSE(LIR) << " - Inputs : Lookups(" << node.getInputs().at(EmbeddingLookup::Input::LOOKUPS)
186 << ") VALUES(" << node.getInputs().at(EmbeddingLookup::Input::VALUES) << ")"
188 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
191 void OperationDumper::visit(const Exp &node)
193 VERBOSE(LIR) << "* Exp" << std::endl;
194 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Exp::Input::INPUT) << ")"
196 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
199 void OperationDumper::visit(const ExpandDims &node)
201 VERBOSE(LIR) << "* ExpandDims" << std::endl;
202 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(ExpandDims::Input::INPUT)
203 << ") AXIS(" << node.getInputs().at(ExpandDims::Input::AXIS) << ")" << std::endl;
204 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
207 void OperationDumper::visit(const Floor &node)
209 VERBOSE(LIR) << "* Floor" << std::endl;
210 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Floor::Input::INPUT) << ")"
212 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
215 void OperationDumper::visit(const FullyConnected &node)
217 VERBOSE(LIR) << "* FullyConnected" << std::endl;
218 VERBOSE(LIR) << " - Inputs : IFM(" << node.getInputs().at(FullyConnected::Input::INPUT)
219 << ") Weight(" << node.getInputs().at(FullyConnected::Input::WEIGHT) << ") Bias("
220 << node.getInputs().at(FullyConnected::Input::BIAS) << ")" << std::endl;
221 VERBOSE(LIR) << " - Output : OFM(" << node.getOutputs().at(0) << ")" << std::endl;
224 void OperationDumper::visit(const Gather &node)
226 VERBOSE(LIR) << "* Gather" << std::endl;
227 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Gather::Input::INPUT) << ") Indices("
228 << node.getInputs().at(Gather::Input::INDICES) << ")" << std::endl;
229 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
232 void OperationDumper::visit(const HashtableLookup &node)
234 VERBOSE(LIR) << "* HashTableLookup" << std::endl;
235 VERBOSE(LIR) << " - Inputs : Lookups(" << node.getInputs().at(HashtableLookup::Input::LOOKUPS)
236 << ") Keys(" << node.getInputs().at(HashtableLookup::Input::KEYS) << ") Values("
237 << node.getInputs().at(HashtableLookup::Input::VALUES) << ")" << std::endl;
238 VERBOSE(LIR) << " - Outputs : Output(" << node.getInputs().at(HashtableLookup::Output::OUTPUT)
239 << ") Hits(" << node.getInputs().at(HashtableLookup::Output::HITS) << ")"
243 void OperationDumper::visit(const InstanceNorm &node)
245 VERBOSE(LIR) << "* InstanceNorm" << std::endl;
246 VERBOSE(LIR) << " - Inputs : IFM(" << node.getInputs().at(InstanceNorm::Input::INPUT)
247 << ") Gamma(" << node.getInputs().at(InstanceNorm::Input::GAMMA) << ") Beta("
248 << node.getInputs().at(InstanceNorm::Input::BETA) << ")" << std::endl;
249 VERBOSE(LIR) << " - Output : OFM(" << node.getOutputs().at(0) << ")" << std::endl;
252 void OperationDumper::visit(const L2Normalization &node)
254 VERBOSE(LIR) << "* L2Normalization" << std::endl;
255 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(L2Normalization::Input::INPUT) << ")"
257 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
260 void OperationDumper::visit(const L2Pool2D &node)
262 VERBOSE(LIR) << "* L2Pool2D" << std::endl;
263 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(L2Pool2D::Input::INPUT) << ")"
265 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
268 void OperationDumper::visit(const LocalResponseNormalization &node)
270 VERBOSE(LIR) << "* LocalResponseNormalization" << std::endl;
271 VERBOSE(LIR) << " - Inputs : Input("
272 << node.getInputs().at(LocalResponseNormalization::Input::INPUT) << ")" << std::endl;
273 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
276 void OperationDumper::visit(const LSTM &node)
279 << " - Inputs : Input(" << node.getInputs().at(LSTM::Input::INPUT)
280 << ") Input To Input Weights(" << node.getInputs().at(LSTM::Input::INPUT_TO_INPUT_WEIGHTS)
281 << ") Input To Forget Weights(" << node.getInputs().at(LSTM::Input::INPUT_TO_FORGET_WEIGHTS)
282 << ") Input To Cell Weights(" << node.getInputs().at(LSTM::Input::INPUT_TO_CELL_WEIGHTS)
283 << ") Input To Output Weights(" << node.getInputs().at(LSTM::Input::INPUT_TO_OUTPUT_WEIGHTS)
284 << ") Recurrent To Input Weights("
285 << node.getInputs().at(LSTM::Input::RECURRENT_TO_INPUT_WEIGHTS)
286 << ") Recurrent To Forget Weights("
287 << node.getInputs().at(LSTM::Input::RECURRENT_TO_FORGET_WEIGHTS)
288 << ") Recurrent To Cell Weights("
289 << node.getInputs().at(LSTM::Input::RECURRENT_TO_CELL_WEIGHTS)
290 << ") Recurrent To Output Weights("
291 << node.getInputs().at(LSTM::Input::RECURRENT_TO_OUTPUT_WEIGHTS) << ") Cell To Input Weights("
292 << node.getInputs().at(LSTM::Input::CELL_TO_INPUT_WEIGHTS) << ") Cell To Forget Weights("
293 << node.getInputs().at(LSTM::Input::CELL_TO_FORGET_WEIGHTS) << ") Cell To OUTPUT Weights("
294 << node.getInputs().at(LSTM::Input::CELL_TO_OUTPUT_WEIGHTS) << ") Input Gate Bias("
295 << node.getInputs().at(LSTM::Input::INPUT_GATE_BIAS) << ") Forget Gate Bias("
296 << node.getInputs().at(LSTM::Input::FORGET_GATE_BIAS) << ") Cell Bias("
297 << node.getInputs().at(LSTM::Input::CELL_BIAS) << ") Output Gate Bias("
298 << node.getInputs().at(LSTM::Input::OUTPUT_GATE_BIAS) << ") Projection Weights("
299 << node.getInputs().at(LSTM::Input::PROJECTION_WEIGHTS) << ") Projection Bias("
300 << node.getInputs().at(LSTM::Input::PROJECTION_BIAS) << ") Output State In("
301 << node.getInputs().at(LSTM::Input::OUTPUT_STATE_IN) << ") Cell State In("
302 << node.getInputs().at(LSTM::Input::CELL_STATE_IN) << ")" << std::endl;
303 VERBOSE(LIR) << " - Output : Scratch Buffer("
304 << node.getOutputs().at(LSTM::Output::SCRATCH_BUFFER) << ") Output State Out("
305 << node.getInputs().at(LSTM::Output::OUTPUT_STATE_OUT) << ") Cell State Out("
306 << node.getInputs().at(LSTM::Output::CELL_STATE_OUT) << ") Output("
307 << node.getInputs().at(LSTM::Output::OUTPUT) << ")" << std::endl;
310 void OperationDumper::visit(const Log &node)
312 VERBOSE(LIR) << "* Log" << std::endl;
313 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Log::Input::INPUT) << ")"
315 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
318 void OperationDumper::visit(const LogicalAnd &node)
320 VERBOSE(LIR) << "* LogicalAnd" << std::endl;
321 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(LogicalAnd::Input::INPUT0) << ", "
322 << node.getInputs().at(LogicalAnd::Input::INPUT1) << ")" << std::endl;
323 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
326 void OperationDumper::visit(const LogicalNot &node)
328 VERBOSE(LIR) << "* LogicalNot" << std::endl;
329 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(LogicalNot::Input::INPUT) << ")"
331 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
334 void OperationDumper::visit(const LogicalOr &node)
336 VERBOSE(LIR) << "* LogicalOr" << std::endl;
337 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(LogicalOr::Input::INPUT0) << ", "
338 << node.getInputs().at(LogicalOr::Input::INPUT1) << ")" << std::endl;
339 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
342 void OperationDumper::visit(const Logistic &node)
344 VERBOSE(LIR) << "* Logistic" << std::endl;
345 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Logistic::Input::INPUT) << ")"
347 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
350 void OperationDumper::visit(const MaxPool2D &node)
352 std::string padding_type =
353 node.param().padding.type == PaddingType::EXPLICIT ? "Explicit" : "Implicit";
354 VERBOSE(LIR) << "* MaxPool2D(" << padding_type << ")" << std::endl;
355 VERBOSE(LIR) << " - Inputs : IFM(" << node.getInputs().at(MaxPool2D::Input::INPUT) << ")"
357 VERBOSE(LIR) << " - Output : OFM(" << node.getOutputs().at(0) << ")" << std::endl;
360 void OperationDumper::visit(const Mul &node)
362 VERBOSE(LIR) << "* Mul" << std::endl;
363 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Mul::Input::LHS) << ", "
364 << node.getInputs().at(Mul::Input::RHS) << ")" << std::endl;
365 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
368 void OperationDumper::visit(const Neg &node)
370 VERBOSE(LIR) << "* Neg" << std::endl;
371 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Neg::Input::INPUT) << ")"
373 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
376 void OperationDumper::visit(const Pack &node)
378 VERBOSE(LIR) << "* Pack" << std::endl;
380 const auto &input_indices = node.getInputs();
381 for (auto it = std::begin(input_indices); it != std::end(input_indices); ++it)
383 inputs += std::to_string(it->value());
384 if (std::next(it) != std::end(input_indices))
387 VERBOSE(LIR) << " - Inputs : Inputs(" << inputs << ")" << std::endl;
388 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
391 void OperationDumper::visit(const Pad &node)
393 VERBOSE(LIR) << "* Pad" << std::endl;
394 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Pad::Input::INPUT) << ") Pad("
395 << node.getInputs().at(Pad::Input::PAD) << ")" << std::endl;
396 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
399 void OperationDumper::visit(const Permute &node)
401 std::string permute_type = "Unknown";
402 switch (node.getPermuteType())
404 case Permute::Type::COPY:
405 permute_type = "Copy";
407 case Permute::Type::NHWC_TO_NCHW:
408 permute_type = "NHWC to NCHW";
410 case Permute::Type::NCHW_TO_NHWC:
411 permute_type = "NCHW to NHWC";
415 VERBOSE(LIR) << "* Permute(" + permute_type + ")" << std::endl;
416 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(0) << ")" << std::endl;
417 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
420 void OperationDumper::visit(const Pow &node)
422 VERBOSE(LIR) << "* Pow" << std::endl;
423 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Pow::Input::LHS) << ", "
424 << node.getInputs().at(Pow::Input::RHS) << ")" << std::endl;
425 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
428 void OperationDumper::visit(const PReLU &node)
430 VERBOSE(LIR) << "* PReLU" << std::endl;
431 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(PReLU::Input::INPUT) << ") Alpha("
432 << node.getInputs().at(PReLU::Input::ALPHA) << ")" << std::endl;
433 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
436 void OperationDumper::visit(const Reduce &node)
438 VERBOSE(LIR) << "* " + node.name() << std::endl;
439 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Reduce::Input::INPUT) << ")"
441 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
444 void OperationDumper::visit(const ReLU &node)
446 VERBOSE(LIR) << "* ReLU" << std::endl;
447 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(ReLU::Input::INPUT) << ")"
449 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
452 void OperationDumper::visit(const ReLU1 &node)
454 VERBOSE(LIR) << "* ReLU1" << std::endl;
455 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(ReLU1::Input::INPUT) << ")"
457 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
460 void OperationDumper::visit(const ReLU6 &node)
462 VERBOSE(LIR) << "* ReLU6" << std::endl;
463 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(ReLU6::Input::INPUT) << ")"
465 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
468 void OperationDumper::visit(const Reshape &node)
470 VERBOSE(LIR) << "* Reshape" << std::endl;
471 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Reshape::Input::INPUT) << ")";
473 if (node.getInputs().size() == 2)
475 VERBOSE(LIR) << " Shape(" << node.getInputs().at(Reshape::Input::SHAPE) << ")";
479 VERBOSE(LIR) << " Shape(not provided)";
481 VERBOSE(LIR) << std::endl;
483 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
486 void OperationDumper::visit(const ResizeBilinear &node)
488 VERBOSE(LIR) << "* ResizeBilinear" << std::endl;
489 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(ResizeBilinear::Input::INPUT) << ")"
491 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
494 void OperationDumper::visit(const Reverse &node)
496 VERBOSE(LIR) << "* Reverse" << std::endl;
497 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Reverse::Input::INPUT) << ") Axis("
498 << node.getInputs().at(Reverse::Input::AXIS) << ")" << std::endl;
499 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
502 void OperationDumper::visit(const RNN &node)
504 VERBOSE(LIR) << "* RNN" << std::endl;
505 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(RNN::Input::INPUT) << ") Weights("
506 << node.getInputs().at(RNN::Input::WEIGHTS) << ") Recurrent Weights("
507 << node.getInputs().at(RNN::Input::RECURRENT_WEIGHTS) << ") Bias("
508 << node.getInputs().at(RNN::Input::BIAS) << ") Hidden State("
509 << node.getInputs().at(RNN::Input::HIDDEN_STATE_IN) << ")" << std::endl;
510 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(RNN::Output::OUTPUT)
511 << ") Hidden State(" << node.getInputs().at(RNN::Output::HIDDEN_STATE_OUT) << ")"
515 void OperationDumper::visit(const Round &node)
517 VERBOSE(LIR) << "* Round" << std::endl;
518 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Round::Input::INPUT) << ")"
520 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
523 void OperationDumper::visit(const Range &node)
525 VERBOSE(LIR) << "* Range" << std::endl;
526 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Range::Input::START) << ")"
527 << " Limit(" << node.getInputs().at(Range::Input::LIMIT) << ")"
528 << " Delta(" << node.getInputs().at(Range::Input::DELTA) << ")" << std::endl;
529 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
532 void OperationDumper::visit(const RSQRT &node)
534 VERBOSE(LIR) << "* RSQRT" << std::endl;
535 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(RSQRT::Input::INPUT) << ")"
537 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
540 void OperationDumper::visit(const Select &node)
542 VERBOSE(LIR) << "* Select" << std::endl;
543 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Select::Input::CONDITION) << ")"
544 << " Input_X(" << node.getInputs().at(Select::Input::INPUT_TRUE) << ")"
545 << " Input_Y(" << node.getInputs().at(Select::Input::INPUT_FALSE) << ")"
547 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
550 void OperationDumper::visit(const ir::operation::Shape &node)
552 VERBOSE(LIR) << "* Shape" << std::endl;
553 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(ir::operation::Shape::Input::INPUT)
555 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
558 void OperationDumper::visit(const Sin &node)
560 VERBOSE(LIR) << "* Sin" << std::endl;
561 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Sin::Input::INPUT) << ")"
563 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
566 void OperationDumper::visit(const Softmax &node)
568 VERBOSE(LIR) << "* Softmax" << std::endl;
569 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Softmax::Input::INPUT) << ")"
571 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
574 void OperationDumper::visit(const SpaceToBatchND &node)
576 VERBOSE(LIR) << "* SpaceToBatchND" << std::endl;
577 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(SpaceToBatchND::Input::INPUT)
578 << ") BlockSize(" << node.getInputs().at(SpaceToBatchND::Input::BLOCK_SIZE)
579 << ") Paddings(" << node.getInputs().at(SpaceToBatchND::Input::PADDINGS) << ")"
581 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
584 void OperationDumper::visit(const SpaceToDepth &node)
586 VERBOSE(LIR) << "* SpaceToDepth" << std::endl;
587 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(SpaceToDepth::Input::INPUT) << ")"
589 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
592 void OperationDumper::visit(const Split &node)
594 VERBOSE(LIR) << "* Split" << std::endl;
595 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Split::Input::INPUT) << ")"
597 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
600 void OperationDumper::visit(const SQRT &node)
602 VERBOSE(LIR) << "* SQRT" << std::endl;
603 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(SQRT::Input::INPUT) << ")"
605 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
608 void OperationDumper::visit(const SquaredDifference &node)
610 VERBOSE(LIR) << "* SquaredDifference" << std::endl;
611 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(SquaredDifference::Input::LHS)
612 << ", " << node.getInputs().at(SquaredDifference::Input::RHS) << ")" << std::endl;
613 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
616 void OperationDumper::visit(const StatelessRandomUniform &node)
618 VERBOSE(LIR) << "* StatelessRandomUniform" << std::endl;
619 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(StatelessRandomUniform::Input::SHAPE)
620 << ", " << node.getInputs().at(StatelessRandomUniform::Input::SEED) << ")"
622 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
625 void OperationDumper::visit(const Squeeze &node)
627 VERBOSE(LIR) << "* Squeeze" << std::endl;
628 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Squeeze::Input::INPUT) << ")"
630 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
633 void OperationDumper::visit(const Slice &node)
635 VERBOSE(LIR) << "* Slice" << std::endl;
636 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Slice::Input::INPUT) << ")"
638 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
641 void OperationDumper::visit(const StridedSlice &node)
643 VERBOSE(LIR) << "* StridedSlice" << std::endl;
644 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(StridedSlice::Input::INPUT) << ")"
646 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
649 void OperationDumper::visit(const Sub &node)
651 VERBOSE(LIR) << "* Sub" << std::endl;
652 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Sub::Input::LHS) << ", "
653 << node.getInputs().at(Sub::Input::RHS) << ")" << std::endl;
654 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
657 void OperationDumper::visit(const Tanh &node)
659 VERBOSE(LIR) << "* TanH" << std::endl;
660 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Tanh::Input::INPUT) << ")"
662 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
665 void OperationDumper::visit(const Tile &node)
667 VERBOSE(LIR) << "* Tile" << std::endl;
668 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Tile::Input::INPUT) << ", "
669 << node.getInputs().at(Tile::Input::MULTIPLES) << ")" << std::endl;
670 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
673 void OperationDumper::visit(const TopKV2 &node)
675 VERBOSE(LIR) << "* TopKV2" << std::endl;
676 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(TopKV2::Input::INPUT) << ")"
678 VERBOSE(LIR) << " - Outputs : Values(" << node.getOutputs().at(TopKV2::Output::OUTPUT_VALUES)
679 << ") Indices(" << node.getOutputs().at(TopKV2::Output::OUTPUT_INDICES) << ")"
683 void OperationDumper::visit(const TransposeConv &node)
685 std::string padding_type =
686 node.param().padding.type == PaddingType::EXPLICIT ? "Explicit" : "Implicit";
687 VERBOSE(LIR) << "* TransposeConv(" << padding_type << ")" << std::endl;
688 VERBOSE(LIR) << " - Inputs : Output Shape("
689 << node.getInputs().at(TransposeConv::Input::OUTPUT_SHAPE) << ") KERNEL("
690 << node.getInputs().at(TransposeConv::Input::KERNEL) << ") IFM("
691 << node.getInputs().at(TransposeConv::Input::INPUT) << ")" << std::endl;
692 VERBOSE(LIR) << " - Output : OFM(" << node.getOutputs().at(0) << ")" << std::endl;
695 void OperationDumper::visit(const Transpose &node)
697 VERBOSE(LIR) << "* Transpose" << std::endl;
698 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Transpose::Input::INPUT) << ")"
700 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
703 void OperationDumper::visit(const Unpack &node)
705 VERBOSE(LIR) << "* Unpack" << std::endl;
706 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Unpack::Input::INPUT) << ")"
709 const auto &output_indices = node.getOutputs();
710 for (auto it = std::begin(output_indices); it != std::end(output_indices); ++it)
712 outputs += std::to_string(it->value());
713 if (std::next(it) != std::end(output_indices))
716 VERBOSE(LIR) << " - Outputs : Outputs(" << outputs << ")" << std::endl;
719 void OperationDumper::visit(const Min &node)
721 VERBOSE(LIR) << "* Min" << std::endl;
722 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Min::Input::LHS) << ", "
723 << node.getInputs().at(Min::Input::RHS) << ")" << std::endl;
724 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
727 void OperationDumper::visit(const Max &node)
729 VERBOSE(LIR) << "* Max" << std::endl;
730 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(Max::Input::LHS) << ", "
731 << node.getInputs().at(Max::Input::RHS) << ")" << std::endl;
732 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
735 void OperationDumper::visit(const OneHot &node)
737 VERBOSE(LIR) << "* OneHot" << std::endl;
738 VERBOSE(LIR) << " - Inputs : "
739 << "Indices(" << node.getInputs().at(OneHot::Input::INDICES) << ") " << std::endl;
740 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;
743 void OperationDumper::visit(const If &node)
745 VERBOSE(LIR) << "* If" << std::endl;
747 const auto &input_indices = node.getInputs();
748 for (auto it = std::begin(input_indices); it != std::end(input_indices); ++it)
750 inputs += std::to_string(it->value());
751 if (std::next(it) != std::end(input_indices))
754 VERBOSE(LIR) << " - Inputs : "
755 << "Then subgraph (" << node.param().then_subg_index << ") Else subgraph ("
756 << node.param().else_subg_index << ") Inputs(" << inputs << ")" << std::endl;
758 const auto &output_indices = node.getOutputs();
759 for (auto it = std::begin(output_indices); it != std::end(output_indices); ++it)
761 outputs += std::to_string(it->value());
762 if (std::next(it) != std::end(output_indices))
765 VERBOSE(LIR) << " - Output : Outputs(" << outputs << ")" << std::endl;
768 void OperationDumper::visit(const While &node)
770 VERBOSE(LIR) << "* While" << std::endl;
772 const auto &input_indices = node.getInputs();
773 for (auto it = std::begin(input_indices); it != std::end(input_indices); ++it)
775 inputs += std::to_string(it->value());
776 if (std::next(it) != std::end(input_indices))
779 VERBOSE(LIR) << " - Inputs : "
780 << "Cond subgraph (" << node.param().cond_subg_index << ") Body subgraph ("
781 << node.param().cond_subg_index << ") Inputs(" << inputs << ")" << std::endl;
783 const auto &output_indices = node.getOutputs();
784 for (auto it = std::begin(output_indices); it != std::end(output_indices); ++it)
786 outputs += std::to_string(it->value());
787 if (std::next(it) != std::end(output_indices))
790 VERBOSE(LIR) << " - Output : Outputs(" << outputs << ")" << std::endl;
793 void OperationDumper::visit(const ZerosLike &node)
795 VERBOSE(LIR) << "* RoZerosLike" << std::endl;
796 VERBOSE(LIR) << " - Inputs : Input(" << node.getInputs().at(ZerosLike::Input::INPUT) << ")"
798 VERBOSE(LIR) << " - Output : Output(" << node.getOutputs().at(0) << ")" << std::endl;