Skip to content

Commit 44eb98a

Browse files
fix bug (#3634)
Co-authored-by: Chunyuan WU <[email protected]>
1 parent 88606e0 commit 44eb98a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

intel_extension_for_pytorch/nn/utils/_parameter_wrapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@ def get_parammeter_from_model(model, name_list):
255255
# for DDP model, there is an extra module
256256
name_list = name_list[1:]
257257
model_or_param = model
258+
# attr may not in custom param. do not convert these attr data to fp32.
258259
for attr in name_list:
259-
model_or_param = getattr(model_or_param, attr)
260+
model_or_param = getattr(model_or_param, attr, None)
260261
return model_or_param
261262

262263
def to_public_fp32(model, state_dict, params_attr):

0 commit comments

Comments
 (0)