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