From 7f652661bfccd61c45b1f6db01a7c7775d1681a6 Mon Sep 17 00:00:00 2001 From: xiaying Date: Fri, 22 Mar 2024 15:59:00 +0800 Subject: [PATCH] Fix bug for metal run for fp16 model --- source/backend/metal/MetalConvolutionCommon.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/backend/metal/MetalConvolutionCommon.mm b/source/backend/metal/MetalConvolutionCommon.mm index 42f9bd690..297c17b00 100644 --- a/source/backend/metal/MetalConvolutionCommon.mm +++ b/source/backend/metal/MetalConvolutionCommon.mm @@ -153,7 +153,7 @@ void weightInBlock(int group, int oc, int ic, int kh, int kw, const FType *src, auto ic = size / kw / kh / (oc / group); // convert - if (loadWeightInt8) { + if (loadWeightInt8 && qnt->weight.get() != nullptr) { auto backend = static_cast(this->backend()); mWeight = weightTransform(group, oc, ic, kh, kw, (float*)qnt->weight.get(), !qnt->canUseInt4, qnt->canUseInt4); auto dequantParams = getDequantScale(qnt->alpha.get(), qnt->alpha.size(), backend, qnt->asymmetric);