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 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;