From 8624ec224ba44a4c04a669a82f4df42869627350 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 27 Dec 2021 19:19:39 +0800 Subject: [PATCH] fix(mgb): fix param merge bug that caused the weight statistics error GitOrigin-RevId: f76a096832ae033eb3d69dbc69360ae1a6b1bb4d --- src/core/impl/graph/cg_impl_seq.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/impl/graph/cg_impl_seq.cpp b/src/core/impl/graph/cg_impl_seq.cpp index 40a6ef01..4a1c731d 100644 --- a/src/core/impl/graph/cg_impl_seq.cpp +++ b/src/core/impl/graph/cg_impl_seq.cpp @@ -539,7 +539,8 @@ void ComputingGraphImpl::ComputingSequence::do_regist() const { auto& mc = mp.chunk(); if (mp.valid() && mc.mem_alloc_status.is_from_owner_var()) { auto size = mgb::get_aligned_power2( - mc.size(), j->comp_node().get_mem_addr_alignment()); + mp.layout().span().dist_byte(), + j->comp_node().get_mem_addr_alignment()); recorder.regist_memory_chunk( {chunk_id++, size, 0, this->m_opr_seq->size(),