287 auto layerType = graphPtr->layers()->Get(layerIndex)->layer_type();
291 case Layer::Layer_AbsLayer:
292 return graphPtr->layers()->Get(layerIndex)->layer_as_AbsLayer()->base();
293 case Layer::Layer_ActivationLayer:
294 return graphPtr->layers()->Get(layerIndex)->layer_as_ActivationLayer()->base();
295 case Layer::Layer_AdditionLayer:
296 return graphPtr->layers()->Get(layerIndex)->layer_as_AdditionLayer()->base();
297 case Layer::Layer_ArgMinMaxLayer:
298 return graphPtr->layers()->Get(layerIndex)->layer_as_ArgMinMaxLayer()->base();
299 case Layer::Layer_BatchMatMulLayer:
300 return graphPtr->layers()->Get(layerIndex)->layer_as_BatchMatMulLayer()->base();
301 case Layer::Layer_BatchToSpaceNdLayer:
302 return graphPtr->layers()->Get(layerIndex)->layer_as_BatchToSpaceNdLayer()->base();
303 case Layer::Layer_BatchNormalizationLayer:
304 return graphPtr->layers()->Get(layerIndex)->layer_as_BatchNormalizationLayer()->base();
305 case Layer::Layer_CastLayer:
306 return graphPtr->layers()->Get(layerIndex)->layer_as_CastLayer()->base();
307 case Layer::Layer_ChannelShuffleLayer:
308 return graphPtr->layers()->Get(layerIndex)->layer_as_ChannelShuffleLayer()->base();
309 case Layer::Layer_ComparisonLayer:
310 return graphPtr->layers()->Get(layerIndex)->layer_as_ComparisonLayer()->base();
311 case Layer::Layer_ConcatLayer:
312 return graphPtr->layers()->Get(layerIndex)->layer_as_ConcatLayer()->base();
313 case Layer::Layer_ConstantLayer:
314 return graphPtr->layers()->Get(layerIndex)->layer_as_ConstantLayer()->base();
315 case Layer::Layer_Convolution2dLayer:
316 return graphPtr->layers()->Get(layerIndex)->layer_as_Convolution2dLayer()->base();
317 case Layer::Layer_Convolution3dLayer:
318 return graphPtr->layers()->Get(layerIndex)->layer_as_Convolution3dLayer()->base();
319 case Layer::Layer_DepthToSpaceLayer:
320 return graphPtr->layers()->Get(layerIndex)->layer_as_DepthToSpaceLayer()->base();
321 case Layer::Layer_DepthwiseConvolution2dLayer:
322 return graphPtr->layers()->Get(layerIndex)->layer_as_DepthwiseConvolution2dLayer()->base();
323 case Layer::Layer_DequantizeLayer:
324 return graphPtr->layers()->Get(layerIndex)->layer_as_DequantizeLayer()->base();
325 case Layer::Layer_DetectionPostProcessLayer:
326 return graphPtr->layers()->Get(layerIndex)->layer_as_DetectionPostProcessLayer()->base();
327 case Layer::Layer_DivisionLayer:
328 return graphPtr->layers()->Get(layerIndex)->layer_as_DivisionLayer()->base();
329 case Layer::Layer_EqualLayer:
330 return graphPtr->layers()->Get(layerIndex)->layer_as_EqualLayer()->base();
331 case Layer::Layer_ElementwiseBinaryLayer:
332 return graphPtr->layers()->Get(layerIndex)->layer_as_ElementwiseBinaryLayer()->base();
333 case Layer::Layer_ElementwiseUnaryLayer:
334 return graphPtr->layers()->Get(layerIndex)->layer_as_ElementwiseUnaryLayer()->base();
335 case Layer::Layer_FullyConnectedLayer:
336 return graphPtr->layers()->Get(layerIndex)->layer_as_FullyConnectedLayer()->base();
337 case Layer::Layer_FillLayer:
338 return graphPtr->layers()->Get(layerIndex)->layer_as_FillLayer()->base();
339 case Layer::Layer_FloorLayer:
340 return graphPtr->layers()->Get(layerIndex)->layer_as_FloorLayer()->base();
341 case Layer::Layer_GatherLayer:
342 return graphPtr->layers()->Get(layerIndex)->layer_as_GatherLayer()->base();
343 case Layer::Layer_GatherNdLayer:
344 return graphPtr->layers()->Get(layerIndex)->layer_as_GatherNdLayer()->base();
345 case Layer::Layer_GreaterLayer:
346 return graphPtr->layers()->Get(layerIndex)->layer_as_GreaterLayer()->base();
347 case Layer::Layer_InputLayer:
348 return graphPtr->layers()->Get(layerIndex)->layer_as_InputLayer()->base()->base();
349 case Layer::Layer_InstanceNormalizationLayer:
350 return graphPtr->layers()->Get(layerIndex)->layer_as_InstanceNormalizationLayer()->base();
351 case Layer::Layer_L2NormalizationLayer:
352 return graphPtr->layers()->Get(layerIndex)->layer_as_L2NormalizationLayer()->base();
353 case Layer::Layer_LogicalBinaryLayer:
354 return graphPtr->layers()->Get(layerIndex)->layer_as_LogicalBinaryLayer()->base();
355 case Layer::Layer_LogSoftmaxLayer:
356 return graphPtr->layers()->Get(layerIndex)->layer_as_LogSoftmaxLayer()->base();
357 case Layer::Layer_LstmLayer:
358 return graphPtr->layers()->Get(layerIndex)->layer_as_LstmLayer()->base();
359 case Layer::Layer_MeanLayer:
360 return graphPtr->layers()->Get(layerIndex)->layer_as_MeanLayer()->base();
361 case Layer::Layer_MinimumLayer:
362 return graphPtr->layers()->Get(layerIndex)->layer_as_MinimumLayer()->base();
363 case Layer::Layer_MaximumLayer:
364 return graphPtr->layers()->Get(layerIndex)->layer_as_MaximumLayer()->base();
365 case Layer::Layer_MergeLayer:
366 return graphPtr->layers()->Get(layerIndex)->layer_as_MergeLayer()->base();
367 case Layer::Layer_MergerLayer:
368 return graphPtr->layers()->Get(layerIndex)->layer_as_MergerLayer()->base();
369 case Layer::Layer_MultiplicationLayer:
370 return graphPtr->layers()->Get(layerIndex)->layer_as_MultiplicationLayer()->base();
371 case Layer::Layer_NormalizationLayer:
372 return graphPtr->layers()->Get(layerIndex)->layer_as_NormalizationLayer()->base();
373 case Layer::Layer_OutputLayer:
374 return graphPtr->layers()->Get(layerIndex)->layer_as_OutputLayer()->base()->base();
375 case Layer::Layer_PadLayer:
376 return graphPtr->layers()->Get(layerIndex)->layer_as_PadLayer()->base();
377 case Layer::Layer_PermuteLayer:
378 return graphPtr->layers()->Get(layerIndex)->layer_as_PermuteLayer()->base();
379 case Layer::Layer_Pooling2dLayer:
380 return graphPtr->layers()->Get(layerIndex)->layer_as_Pooling2dLayer()->base();
381 case Layer::Layer_Pooling3dLayer:
382 return graphPtr->layers()->Get(layerIndex)->layer_as_Pooling3dLayer()->base();
383 case Layer::Layer_PreluLayer:
384 return graphPtr->layers()->Get(layerIndex)->layer_as_PreluLayer()->base();
385 case Layer::Layer_QLstmLayer:
386 return graphPtr->layers()->Get(layerIndex)->layer_as_QLstmLayer()->base();
387 case Layer::Layer_QuantizeLayer:
388 return graphPtr->layers()->Get(layerIndex)->layer_as_QuantizeLayer()->base();
389 case Layer::Layer_QuantizedLstmLayer:
390 return graphPtr->layers()->Get(layerIndex)->layer_as_QuantizedLstmLayer()->base();
391 case Layer::Layer_RankLayer:
392 return graphPtr->layers()->Get(layerIndex)->layer_as_RankLayer()->base();
393 case Layer::Layer_ReduceLayer:
394 return graphPtr->layers()->Get(layerIndex)->layer_as_ReduceLayer()->base();
395 case Layer::Layer_ReshapeLayer:
396 return graphPtr->layers()->Get(layerIndex)->layer_as_ReshapeLayer()->base();
397 case Layer::Layer_ResizeBilinearLayer:
398 return graphPtr->layers()->Get(layerIndex)->layer_as_ResizeBilinearLayer()->base();
399 case Layer::Layer_ResizeLayer:
400 return graphPtr->layers()->Get(layerIndex)->layer_as_ResizeLayer()->base();
401 case Layer::Layer_ReverseV2Layer:
402 return graphPtr->layers()->Get(layerIndex)->layer_as_ReverseV2Layer()->base();
403 case Layer::Layer_RsqrtLayer:
404 return graphPtr->layers()->Get(layerIndex)->layer_as_RsqrtLayer()->base();
405 case Layer::Layer_ShapeLayer:
406 return graphPtr->layers()->Get(layerIndex)->layer_as_ShapeLayer()->base();
407 case Layer::Layer_SliceLayer:
408 return graphPtr->layers()->Get(layerIndex)->layer_as_SliceLayer()->base();
409 case Layer::Layer_SoftmaxLayer:
410 return graphPtr->layers()->Get(layerIndex)->layer_as_SoftmaxLayer()->base();
411 case Layer::Layer_SpaceToBatchNdLayer:
412 return graphPtr->layers()->Get(layerIndex)->layer_as_SpaceToBatchNdLayer()->base();
413 case Layer::Layer_SpaceToDepthLayer:
414 return graphPtr->layers()->Get(layerIndex)->layer_as_SpaceToDepthLayer()->base();
415 case Layer::Layer_SplitterLayer:
416 return graphPtr->layers()->Get(layerIndex)->layer_as_SplitterLayer()->base();
417 case Layer::Layer_StackLayer:
418 return graphPtr->layers()->Get(layerIndex)->layer_as_StackLayer()->base();
419 case Layer::Layer_StandInLayer:
420 return graphPtr->layers()->Get(layerIndex)->layer_as_StandInLayer()->base();
421 case Layer::Layer_StridedSliceLayer:
422 return graphPtr->layers()->Get(layerIndex)->layer_as_StridedSliceLayer()->base();
423 case Layer::Layer_SubtractionLayer:
424 return graphPtr->layers()->Get(layerIndex)->layer_as_SubtractionLayer()->base();
425 case Layer::Layer_SwitchLayer:
426 return graphPtr->layers()->Get(layerIndex)->layer_as_SwitchLayer()->base();
427 case Layer::Layer_TileLayer:
428 return graphPtr->layers()->Get(layerIndex)->layer_as_TileLayer()->base();
429 case Layer::Layer_TransposeConvolution2dLayer:
430 return graphPtr->layers()->Get(layerIndex)->layer_as_TransposeConvolution2dLayer()->base();
431 case Layer::Layer_TransposeLayer:
432 return graphPtr->layers()->Get(layerIndex)->layer_as_TransposeLayer()->base();
433 case Layer::Layer_UnidirectionalSequenceLstmLayer:
434 return graphPtr->layers()->Get(layerIndex)->layer_as_UnidirectionalSequenceLstmLayer()->base();
435 case Layer::Layer_NONE:
437 throw ParseException(fmt::format(
"Layer type {} not recognized", layerType));