Skip to content

Commit 74e18a6

Browse files
committed
update
1 parent b9395c4 commit 74e18a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

intel_extension_for_pytorch/nn/utils/_parameter_wrapper.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,11 @@ def get_parammeter_from_model(model, name_list):
256256
name_list = name_list[1:]
257257
model_or_param = model
258258
for attr in name_list:
259-
model_or_param = getattr(model_or_param, attr)
259+
model_or_param_new = getattr(model_or_param, attr, None)
260+
if model_or_param_new is None:
261+
if getattr(model_or_param, "quant_state", None) is not None:
262+
model_or_param_new = getattr(model_or_param.quant_state, attr, None)
263+
model_or_param = model_or_param_new
260264
return model_or_param
261265

262266
def to_public_fp32(model, state_dict, params_attr):

0 commit comments

Comments
 (0)