From 9605e9ad12b2e4e47660af4df95c43d489ab15c3 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Thu, 7 Nov 2024 01:54:13 -0500 Subject: [PATCH] fix hybrid Signed-off-by: Jinzhe Zeng --- deepmd/dpmodel/descriptor/hybrid.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deepmd/dpmodel/descriptor/hybrid.py b/deepmd/dpmodel/descriptor/hybrid.py index 5502688dce..f6a4ba6a1d 100644 --- a/deepmd/dpmodel/descriptor/hybrid.py +++ b/deepmd/dpmodel/descriptor/hybrid.py @@ -58,9 +58,10 @@ def __init__( if isinstance(ii, BaseDescriptor): formatted_descript_list.append(ii) elif isinstance(ii, dict): - formatted_descript_list.append( - BaseDescriptor(**ii, type_map=type_map, ntypes=ntypes) - ) + ii = ii.copy() + ii["type_map"] = type_map + ii["ntypes"] = ntypes + formatted_descript_list.append(BaseDescriptor(**ii)) else: raise NotImplementedError self.descrpt_list = formatted_descript_list