@@ -16,8 +16,8 @@ using namespace it_lab_ai;
1616
1717void alexnet_inf_careless (Graph& graph, const RuntimeOptions& options,
1818 Tensor& input, Tensor& output) {
19- Tensor * o = new Tensor (output);
20- Tensor * i = new Tensor (input);
19+ auto * o = new Tensor (output);
20+ auto * i = new Tensor (input);
2121 graph.inference (options);
2222 graph.setOutput (*o);
2323 graph.setInput (*i);
@@ -28,7 +28,7 @@ void alexnet_comparison() {
2828 891 , 957 , 1027 , 973 , 1008 };
2929 size_t sum = std::accumulate (counts.begin (), counts.end (), size_t {0 });
3030 int count_pic = static_cast <int >(sum) + 10 ;
31- std::vector<float > res (count_pic * 28 * 28 , 1 .0f );
31+ std::vector<float > res (count_pic * 28 * 28 , 1 .0F );
3232 Tensor input;
3333 Shape sh1 ({1 , 5 , 5 , 3 });
3434 std::vector<float > vec;
@@ -43,21 +43,21 @@ void alexnet_comparison() {
4343 input = t;
4444
4545 RuntimeOptions options;
46- Graph graph1 ;
46+ Graph graph ;
4747 Graph graph2;
48- build_graph_linear (graph1 , input, output, options, true );
48+ build_graph_linear (graph , input, output, options, true );
4949 Graph subgraph;
5050 std::shared_ptr<Layer> layer_0 = std::make_shared<ConvolutionalLayer>();
5151 std::shared_ptr<Layer> layer_1 = std::make_shared<EWLayer>(" relu" );
5252 subgraph.setInput (layer_0, input);
5353 subgraph.makeConnection (layer_0, layer_1);
5454 std::shared_ptr<Layer> layer_to = std::make_shared<ConvReluLayer>(
5555 std::dynamic_pointer_cast<ConvolutionalLayer>(layer_0));
56- changed_subgraphs (graph1 , subgraph, layer_to, graph2, input, options);
56+ changed_subgraphs (graph , subgraph, layer_to, graph2, input, options);
5757 Tensor input_c = input;
5858 Tensor output_c = output;
5959 double time1 = elapsed_time_avg<double , std::milli>(
60- 2 , alexnet_inf_careless, graph1 , options, input_c, output_c);
60+ 2 , alexnet_inf_careless, graph , options, input_c, output_c);
6161 double time2 = elapsed_time_avg<double , std::milli>(
6262 2 , alexnet_inf_careless, graph2, options, input_c, output_c);
6363 std::cout << time1 << " for unchanged graph\n " ;
@@ -74,7 +74,7 @@ int main() {
7474 build_graph (graph1, input, input, MODEL_PATH_DENSENET_ONNX , options, false );
7575
7676 Graph subgraph;
77- Tensor scale = make_tensor (std::vector<float >({1.0 }));
77+ Tensor scale = make_tensor (std::vector<float >({1 .0F }));
7878 std::shared_ptr<Layer> layer_0 =
7979 std::make_shared<BatchNormalizationLayer>(scale, scale, scale, scale);
8080 std::shared_ptr<Layer> layer_1 = std::make_shared<EWLayer>(" relu" );
0 commit comments