From fa4bcba08224f4bb21655b5ce0aab2e31c65f43b Mon Sep 17 00:00:00 2001 From: xiaying Date: Fri, 20 Dec 2024 17:18:13 +0800 Subject: [PATCH 1/2] Converter:Bugfix: Fix bug for trilu onnx convert --- tools/converter/source/optimizer/onnxextra/OnnxPrelu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/converter/source/optimizer/onnxextra/OnnxPrelu.cpp b/tools/converter/source/optimizer/onnxextra/OnnxPrelu.cpp index e10738ca9..689aeec6b 100644 --- a/tools/converter/source/optimizer/onnxextra/OnnxPrelu.cpp +++ b/tools/converter/source/optimizer/onnxextra/OnnxPrelu.cpp @@ -134,7 +134,7 @@ class OnnxTriluTransform : public OnnxExtraManager::Transform { } auto k = (inputs.size() == 2 ? inputs[1] : _Scalar(0)); auto mask = (upper ? _GreaterEqual(rangeW, rangeH + k) : _GreaterEqual(rangeH, rangeW - k)); - mask = _Reshape(mask, _Concat({_Fill(_Size(shape) - _Scalar(2), oneV), _Shape(mask)}, 0)); + mask = _Reshape(mask, _Concat({_Fill(_Unsqueeze(_Size(shape) - _Scalar(2), {0}), oneV), _Shape(mask)}, 0)); auto res = _Select(mask, inputs[0], zero); res->setName(expr->outputName(0)); return res->expr().first; From e6180bd3ce9cef7c04852b2dc6bf2f32e6e610ee Mon Sep 17 00:00:00 2001 From: xiaying Date: Sun, 22 Dec 2024 17:45:01 +0800 Subject: [PATCH 2/2] OpenCL:Bugfix: Fix bug for getInfo when create Error --- source/backend/opencl/core/runtime/OpenCLRuntime.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/backend/opencl/core/runtime/OpenCLRuntime.cpp b/source/backend/opencl/core/runtime/OpenCLRuntime.cpp index e25aef71d..5ba3caaf6 100644 --- a/source/backend/opencl/core/runtime/OpenCLRuntime.cpp +++ b/source/backend/opencl/core/runtime/OpenCLRuntime.cpp @@ -296,11 +296,12 @@ OpenCLRuntime::OpenCLRuntime(const BackendConfig::PrecisionMode precision, const }else{ mIsCreateError = true; - MNN_ASSERT(1 <= gpuDevices.size()); } }else{ mIsCreateError = true; - MNN_ASSERT(platforms.size() > 0); + } + if (mIsCreateError) { + return; } { // Init info