Skip to content

Commit 94e1212

Browse files
authored
Merge pull request #2599 from wangzhaode/feature/bugfix_compile
[Compile:Bugfix] Bugfix of action and compile.
2 parents 38b7196 + 05a1623 commit 94e1212

File tree

9 files changed

+20
-10
lines changed

9 files changed

+20
-10
lines changed

Diff for: .github/workflows/pymnn_macos.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ jobs:
2626
- uses: actions/checkout@v3
2727
- uses: actions/setup-python@v4
2828
with:
29-
python-version: '3.9'
29+
python-version: '3.8.10'
3030
- name: prepare
3131
run: |
3232
pip3 install numpy opencv-python torch
3333
- name: build
3434
run: |
3535
cd pymnn/pip_package
3636
python3 build_deps.py
37-
sudo python3 setup.py install --version 1.0
37+
python3 setup.py install --version 1.0
3838
- name: test
3939
run: |
4040
cd pymnn/test

Diff for: package_scripts/win/build_lib_release.ps1

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ mkdir -p $PACKAGE_LIB_PATH
2626

2727
#clear and create package directory
2828
powershell ./schema/generate.ps1
29-
pushd $PACKAGE_LIB_PATH
29+
3030
if ($cibuild) {
31+
pushd $PACKAGE_LIB_PATH
3132
mkdir -p Release\Dynamic\MT
3233
} else {
3334
Remove-Item -Path $PACKAGE_PATH/include -Recurse -ErrorAction Ignore
3435
cp -r include $PACKAGE_PATH
3536
cp -r tools/cv/include/cv $PACKAGE_PATH/include
37+
pushd $PACKAGE_LIB_PATH
3638
mkdir -p Release\Dynamic\MT, Release\Dynamic\MD, Release\Static\MD, Release\Static\MT
3739
}
3840
popd

Diff for: pymnn/test/unit_test.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def test_greater_equal(self):
194194
def test_less(self):
195195
self.assertEqualVar(expr.less(self.x, self.x), np.less(self.x_, self.x_))
196196
def test_floordiv(self):
197-
self.assertEqualVar(expr.floordiv(self.x, self.x), np.floor_divide(self.x_, self.x_))
197+
self.assertEqualVar(expr.floordiv(2.0, 1.2), np.floor_divide(2.0, 1.2))
198198
def test_less(self):
199199
self.assertEqualVar(expr.less(self.x, self.x), np.less(self.x_, self.x_))
200200
def test_squared_difference(self):
@@ -784,7 +784,9 @@ def test_Structural(self):
784784
rect = cv.minAreaRect(contour)
785785
rect_ = cv2.minAreaRect(contour_)
786786
if version_info.major >= 3:
787-
self.assertEqual(rect, rect_)
787+
rect_list = [rect[0][0], rect[0][1], rect[1][0], rect[1][0], rect[2]]
788+
rect__list = [rect_[0][0], rect_[0][1], rect_[1][0], rect_[1][0], rect_[2]]
789+
self.assertEqualArray(np.array(rect_list), np.array(rect__list))
788790
points = cv.boxPoints(rect)
789791
points_ = cv2.boxPoints(rect_)
790792
if version_info.major >= 3:

Diff for: source/backend/cuda/core/CUDABackend.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ void CUDABackend::onResizeBegin() {
302302
}
303303

304304
ErrorCode CUDABackend::onResizeEnd() {
305+
return NO_ERROR;
305306
}
306307

307308
void CUDABackend::onExecuteBegin() const {

Diff for: source/backend/opengl/GLBackend.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ class GLBackend : public Backend {
9999

100100
virtual void onExecuteEnd() const override;
101101

102+
ErrorCode onResizeEnd() { return NO_ERROR; }
103+
102104
/// get execution
103105
virtual Execution* onCreate(const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs,
104106
const MNN::Op* op) override;

Diff for: source/core/Backend.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ bool Backend::onAcquireBuffer(const Tensor* tensor, StorageType storageType) {
8383
TensorUtils::getDescribe(tensor)->mem.reset(mem);
8484
return true;
8585
}
86+
ErrorCode Backend::onResizeEnd() {
87+
return NO_ERROR;
88+
}
8689
bool Backend::onReleaseBuffer(const Tensor* tensor, StorageType storageType) {
8790
TensorUtils::getDescribe(tensor)->mem.reset(nullptr);
8891
return true;

Diff for: source/core/Backend.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ class Backend : public NonCopyable {
115115
/**
116116
* @brief callback after resize ops.
117117
*/
118-
virtual ErrorCode onResizeEnd() {
119-
// nothing to do
120-
return NO_ERROR;
121-
}
118+
virtual ErrorCode onResizeEnd();
122119

123120
/**
124121
* @brief callback before executing ops.

Diff for: source/core/BufferAllocator.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ class RecurseAllocator : public BufferAllocator::Allocator {
7272
BufferAllocator* mParent;
7373
};
7474

75+
ErrorCode BufferAllocator::compute() {
76+
return NO_ERROR;
77+
}
7578
std::shared_ptr<BufferAllocator::Allocator> BufferAllocator::Allocator::createDefault() {
7679
std::shared_ptr<BufferAllocator::Allocator> _res;
7780
_res.reset(new DefaultAllocator);

Diff for: source/core/BufferAllocator.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class MNN_PUBLIC BufferAllocator : public NonCopyable {
9898
virtual void beginGroup() {}
9999
virtual void endGroup() {}
100100
virtual void reset() {}
101-
virtual ErrorCode compute() { return NO_ERROR; }
101+
virtual ErrorCode compute();
102102
};
103103

104104

0 commit comments

Comments
 (0)