Skip to content

Commit 2dd056b

Browse files
author
NeiroYT
committed
Revert "Merge"
This reverts commit 10e19cf, reversing changes made to 0f3ac42.
1 parent 10e19cf commit 2dd056b

28 files changed

+51911
-1098
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Checks: >
2727
-bugprone-easily-swappable-parameters,
2828
-bugprone-implicit-widening-of-multiplication-result,
2929
-bugprone-unchecked-optional-access,
30+
-clang-analyzer-security.insecureAPI.rand,
3031
3132
WarningsAsErrors: "*"
3233

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: DoozyX/clang-format-lint-action@v0.15
1616
with:
17-
source: './app ./include ./src ./test'
17+
source: '.'
1818
build-linux:
1919
strategy:
2020
matrix:

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.20)
22

33
project(ITLabAI)
44

5-
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
6-
75
option(ENABLE_STATISTIC_TENSORS "Enable statistic tensors" OFF)
86

97
if(ENABLE_STATISTIC_TENSORS)
@@ -34,7 +32,9 @@ add_subdirectory(3rdparty)
3432

3533
include(cmake/opencv_config.cmake)
3634

37-
find_package(OpenMP REQUIRED)
35+
if (NOT WIN32)
36+
find_package(OpenMP REQUIRED)
37+
endif()
3838

3939
if (NOT WIN32)
4040
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")

app/Accuracy/accuracy_check.cpp

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main() {
3434
}
3535
Shape sh({static_cast<size_t>(count_pic), 227, 227, 3});
3636
Tensor t = make_tensor<float>(res, sh);
37-
Graph graph;
37+
Graph graph(6);
3838
Shape sh1({1, 5, 5, 3});
3939
std::vector<float> vec;
4040
vec.reserve(75);
@@ -43,29 +43,23 @@ int main() {
4343
}
4444
Tensor input = t;
4545
Tensor output = make_tensor(vec, sh1);
46-
auto a1 = std::make_unique<InputLayer>(kNchw, kNchw, 1, 2);
47-
Layer* a1_ptr = a1.get();
46+
auto a1 = std::make_shared<InputLayer>(kNchw, kNchw, 1, 2);
4847
std::vector<float> kernelvec = {1, 1, 1, 1, 1, 1, 1, 1, 1};
4948
Shape sh2({3, 3});
5049
Tensor kernel = make_tensor(kernelvec, sh2);
51-
auto a2 = std::make_unique<ConvolutionalLayer>(1, 0, 0, kernel);
52-
Layer* a2_ptr = a2.get();
50+
auto a2 = std::make_shared<ConvolutionalLayer>(1, 0, 0, kernel);
5351
Shape poolshape = {2, 2};
54-
auto a3 = std::make_unique<EWLayer>("linear", 2.0F, 3.0F);
55-
Layer* a3_ptr = a3.get();
56-
auto a4 = std::make_unique<PoolingLayer>(poolshape, "average");
57-
Layer* a4_ptr = a4.get();
58-
auto a5 = std::make_unique<OutputLayer>();
59-
Layer* a5_ptr = a5.get();
60-
auto a6 = std::make_unique<FCLayer>();
61-
Layer* a6_ptr = a6.get();
62-
graph.setInput(a1_ptr, input);
63-
graph.makeConnection(a1_ptr, a2_ptr);
64-
graph.makeConnection(a2_ptr, a3_ptr);
65-
graph.makeConnection(a3_ptr, a4_ptr);
66-
graph.makeConnection(a4_ptr, a5_ptr);
67-
graph.makeConnection(a5_ptr, a6_ptr);
68-
graph.setOutput(a5_ptr, output);
52+
auto a3 = std::make_shared<EWLayer>("linear", 2.0F, 3.0F);
53+
auto a4 = std::make_shared<PoolingLayer>(poolshape, "average");
54+
auto a5 = std::make_shared<OutputLayer>();
55+
auto a6 = std::make_shared<FCLayer>();
56+
graph.setInput(a1, input);
57+
graph.makeConnection(a1, a2);
58+
graph.makeConnection(a2, a3);
59+
graph.makeConnection(a3, a4);
60+
graph.makeConnection(a4, a5);
61+
graph.makeConnection(a5, a6);
62+
graph.setOutput(a5, output);
6963
graph.inference();
7064
std::vector<float> tmp = *output.as<float>();
7165
std::vector<float> tmp_output = softmax<float>(*output.as<float>());

app/AccuracyImgNet/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
add_executable(ACCImgNet accimgnet.cpp)
2+
3+
find_package( OpenCV REQUIRED PATHS "${OPENCV_BUILD_DIR}" )
4+
include_directories( ${OpenCV_INCLUDE_DIRS} )
5+
target_link_libraries( ACCImgNet ${OpenCV_LIBS} )
6+
target_link_libraries( ACCImgNet TBB_unified)
7+
target_link_libraries( ACCImgNet layers_lib)
8+
target_link_libraries( ACCImgNet gtest_main)

0 commit comments

Comments
 (0)