Skip to content

Commit 7d0b2d8

Browse files
Merge branch 'main' into AndreySorokin7/add_parall_kokkos
2 parents 2026ace + 131db58 commit 7d0b2d8

File tree

14 files changed

+2190
-867
lines changed

14 files changed

+2190
-867
lines changed

app/Accuracy/accuracy_check.cpp

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,29 +47,23 @@ int main() {
4747
}
4848
Tensor input = t;
4949
Tensor output = make_tensor(vec, sh1);
50-
auto a1 = std::make_unique<InputLayer>(kNchw, kNchw, 1, 2);
51-
Layer* a1_ptr = a1.get();
50+
auto a1 = std::make_shared<InputLayer>(kNchw, kNchw, 1, 2);
5251
std::vector<float> kernelvec = {1, 1, 1, 1, 1, 1, 1, 1, 1};
5352
Shape sh2({3, 3});
5453
Tensor kernel = make_tensor(kernelvec, sh2);
55-
auto a2 = std::make_unique<ConvolutionalLayer>(1, 0, 0, kernel);
56-
Layer* a2_ptr = a2.get();
54+
auto a2 = std::make_shared<ConvolutionalLayer>(1, 0, 0, kernel);
5755
Shape poolshape = {2, 2};
58-
auto a3 = std::make_unique<EWLayer>("linear", 2.0F, 3.0F);
59-
Layer* a3_ptr = a3.get();
60-
auto a4 = std::make_unique<PoolingLayer>(poolshape, "average");
61-
Layer* a4_ptr = a4.get();
62-
auto a5 = std::make_unique<OutputLayer>();
63-
Layer* a5_ptr = a5.get();
64-
auto a6 = std::make_unique<FCLayer>();
65-
Layer* a6_ptr = a6.get();
66-
graph.setInput(a1_ptr, input);
67-
graph.makeConnection(a1_ptr, a2_ptr);
68-
graph.makeConnection(a2_ptr, a3_ptr);
69-
graph.makeConnection(a3_ptr, a4_ptr);
70-
graph.makeConnection(a4_ptr, a5_ptr);
71-
graph.makeConnection(a5_ptr, a6_ptr);
72-
graph.setOutput(a5_ptr, output);
56+
auto a3 = std::make_shared<EWLayer>("linear", 2.0F, 3.0F);
57+
auto a4 = std::make_shared<PoolingLayer>(poolshape, "average");
58+
auto a5 = std::make_shared<OutputLayer>();
59+
auto a6 = std::make_shared<FCLayer>();
60+
graph.setInput(a1, input);
61+
graph.makeConnection(a1, a2);
62+
graph.makeConnection(a2, a3);
63+
graph.makeConnection(a3, a4);
64+
graph.makeConnection(a4, a5);
65+
graph.makeConnection(a5, a6);
66+
graph.setOutput(a5, output);
7367
graph.inference(options);
7468
std::vector<float> tmp = *output.as<float>();
7569
std::vector<float> tmp_output = softmax<float>(*output.as<float>());

app/Graph/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ target_link_libraries(Graph_Build BuildGraph)
2222
add_executable(ACC acc_check.cpp)
2323
target_link_libraries(ACC BuildGraph)
2424

25+
add_executable(onnx_subgraphs onnx_subgraphs.cpp)
26+
target_link_libraries(onnx_subgraphs BuildGraph)
27+
target_link_libraries(onnx_subgraphs OpenMP::OpenMP_CXX)
28+
target_link_libraries(onnx_subgraphs graphT_lib)
29+
2530
file(DOWNLOAD
2631
"https://raw.githubusercontent.com/DeepTrackAI/MNIST_dataset/main/mnist/test/1_000008.png"
2732
"${CMAKE_SOURCE_DIR}/docs/input/28/test1.png"

0 commit comments

Comments
 (0)