@@ -298,7 +298,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
298298
299299 auto input_layer = std::make_shared<it_lab_ai::InputLayer>(it_lab_ai::kNchw ,
300300 it_lab_ai::kNchw );
301- input_layer->setName (it_lab_ai::kInput );
302301 layers.push_back (input_layer);
303302 name_to_layer[input_layer_name] = input_layer;
304303 int current_id = 0 ;
@@ -374,16 +373,13 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
374373
375374 auto conv_layer = std::make_shared<it_lab_ai::ConvolutionalLayer>(
376375 stride, pads, dilations, tmp_tensor, tmp_bias, impl2, group);
377- conv_layer->setName (it_lab_ai::kConvolution );
378376 layer = conv_layer;
379377 } else if (layer_type.find (" Relu" ) != std::string::npos ||
380378 layer_type.find (" relu" ) != std::string::npos) {
381379 auto ew_layer = std::make_shared<it_lab_ai::EWLayer>(" relu" );
382- ew_layer->setName (it_lab_ai::kElementWise );
383380 layer = ew_layer;
384381 } else if (layer_type.find (" Sigmoid" ) != std::string::npos) {
385382 auto ew_layer = std::make_shared<it_lab_ai::EWLayer>(" sigmoid" );
386- ew_layer->setName (it_lab_ai::kElementWise );
387383 layer = ew_layer;
388384
389385 } else if (layer_type.find (" Dense" ) != std::string::npos ||
@@ -404,11 +400,9 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
404400 it_lab_ai::Tensor tmp_bias = it_lab_ai::make_tensor (tensor.get_bias ());
405401 auto fc_layer =
406402 std::make_shared<it_lab_ai::FCLayer>(tmp_tensor, tmp_bias);
407- fc_layer->setName (it_lab_ai::kFullyConnected );
408403 layer = fc_layer;
409404 } else if (layer_type.find (" Dropout" ) != std::string::npos) {
410405 auto dropout_layer = std::make_shared<it_lab_ai::DropOutLayer>(0.0 );
411- dropout_layer->setName (it_lab_ai::kDropout );
412406 layer = dropout_layer;
413407 if (comments)
414408 std::cout
@@ -418,7 +412,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
418412 } else if (layer_type == " GlobalAveragePool" ) {
419413 auto pool_layer = std::make_shared<it_lab_ai::PoolingLayer>(
420414 it_lab_ai::Shape ({0 , 0 }), " average" , impl1);
421- pool_layer->setName (it_lab_ai::kPooling );
422415 layer = pool_layer;
423416 if (comments) {
424417 std::cout << " GlobalAveragePool layer added (will use input spatial "
@@ -503,8 +496,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
503496 << e.what () << std::endl;
504497 }
505498 }
506-
507- pool_layer->setName (it_lab_ai::kPooling );
508499 layer = pool_layer;
509500 } else if (layer_type.find (" Flatten" ) != std::string::npos) {
510501 int axis = 1 ;
@@ -516,7 +507,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
516507 }
517508 }
518509 auto flatten_layer = std::make_shared<it_lab_ai::FlattenLayer>(axis);
519- flatten_layer->setName (it_lab_ai::kFlatten );
520510 layer = flatten_layer;
521511 } else if (layer_type == " Concat" ) {
522512 int axis = 0 ;
@@ -531,7 +521,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
531521 }
532522 }
533523 auto concat_layer = std::make_shared<it_lab_ai::ConcatLayer>(axis);
534- concat_layer->setName (it_lab_ai::kConcat );
535524 layer = concat_layer;
536525 concat_connected_inputs[layer_name] = std::unordered_set<std::string>();
537526 } else if (layer_type == " Split" ) {
@@ -564,7 +553,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
564553
565554 auto split_layer =
566555 std::make_shared<it_lab_ai::SplitLayer>(axis, splits);
567- split_layer->setName (it_lab_ai::kSplit );
568556 layer = split_layer;
569557
570558 split_layers[layer_name] = split_layer;
@@ -619,7 +607,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
619607 ew_operation = " linear" ;
620608 auto ew_layer =
621609 std::make_shared<it_lab_ai::EWLayer>(ew_operation, value, 0 .0F );
622- ew_layer->setName (it_lab_ai::kElementWise );
623610 layer = ew_layer;
624611 if (comments) {
625612 std::cout << " Created binary " << layer_type << " operation with "
@@ -629,13 +616,11 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
629616 ew_operation = " linear" ;
630617 auto ew_layer =
631618 std::make_shared<it_lab_ai::EWLayer>(ew_operation, 1 .0F , value);
632- ew_layer->setName (it_lab_ai::kElementWise );
633619 layer = ew_layer;
634620 } else if (layer_type == " Sub" ) {
635621 ew_operation = " linear" ;
636622 auto ew_layer = std::make_shared<it_lab_ai::EWLayer>(ew_operation,
637623 1 .0F , -value);
638- ew_layer->setName (it_lab_ai::kElementWise );
639624 layer = ew_layer;
640625 } else {
641626 continue ;
@@ -652,7 +637,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
652637 op = it_lab_ai::BinaryOpLayer::Operation::kDiv ;
653638
654639 auto bin_layer = std::make_shared<it_lab_ai::BinaryOpLayer>(op);
655- bin_layer->setName (it_lab_ai::kBinaryOp );
656640 layer = bin_layer;
657641 }
658642 } else if (layer_type == " Gemm" ) {
@@ -716,7 +700,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
716700
717701 auto fc_layer =
718702 std::make_shared<it_lab_ai::FCLayer>(tmp_tensor, tmp_bias);
719- fc_layer->setName (it_lab_ai::kFullyConnected );
720703 layer = fc_layer;
721704 } else if (layer_type == " Transpose" ||
722705 layer_type.find (" transpose" ) != std::string::npos) {
@@ -733,7 +716,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
733716
734717 auto transpose_layer =
735718 std::make_shared<it_lab_ai::TransposeLayer>(perm);
736- transpose_layer->setName (it_lab_ai::kTranspose );
737719 layer = transpose_layer;
738720
739721 if (comments) {
@@ -779,7 +761,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
779761
780762 auto reshape_layer =
781763 std::make_shared<it_lab_ai::ReshapeLayer>(allowzero, shape);
782- reshape_layer->setName (it_lab_ai::kReshape );
783764 layer = reshape_layer;
784765
785766 } else if (layer_type == " ReduceMean" ) {
@@ -800,7 +781,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
800781 }
801782 auto reduce_layer = std::make_shared<it_lab_ai::ReduceLayer>(
802783 it_lab_ai::ReduceLayer::Operation::kMean , keepdims, axes);
803- reduce_layer->setName (it_lab_ai::kReduce );
804784 layer = reduce_layer;
805785 } else if (layer_type == " ReduceSum" ) {
806786 int64_t keepdims = 0 ;
@@ -828,7 +808,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
828808 }
829809 auto reduce_layer = std::make_shared<it_lab_ai::ReduceLayer>(
830810 it_lab_ai::ReduceLayer::Operation::kSum , keepdims, axes);
831- reduce_layer->setName (it_lab_ai::kReduce );
832811 layer = reduce_layer;
833812 } else if (layer_type == " Constant" ) {
834813 if (layer_data.contains (" attributes" )) {
@@ -852,7 +831,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
852831 continue ;
853832 } else if (layer_type == " MatMul" ) {
854833 auto matmul_layer = std::make_shared<it_lab_ai::MatmulLayer>();
855- matmul_layer->setName (it_lab_ai::kMatmul );
856834 layer = matmul_layer;
857835
858836 } else if (layer_type == " Softmax" ) {
@@ -865,7 +843,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
865843 }
866844 }
867845 auto softmax_layer = std::make_shared<it_lab_ai::SoftmaxLayer>(axis);
868- softmax_layer->setName (it_lab_ai::kSoftmax );
869846 layer = softmax_layer;
870847
871848 } else if (layer_type == " BatchNormalization" ) {
@@ -932,7 +909,6 @@ void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output,
932909
933910 auto bn_layer = std::make_shared<it_lab_ai::BatchNormalizationLayer>(
934911 scale, bias, mean, var, epsilon, momentum, training_mode);
935- bn_layer->setName (it_lab_ai::kBatchNormalization );
936912 layer = bn_layer;
937913 } else {
938914 continue ;
0 commit comments