File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -483,10 +483,22 @@ def _get_new_signature( # noqa: C901
483
483
elif is_tagged :
484
484
input_specs .append (orig_input_spec )
485
485
486
- if orig_input_spec .kind in ( InputKind .PARAMETER , InputKind . BUFFER ) :
486
+ if orig_input_spec .kind == InputKind .PARAMETER :
487
487
new_state_dict [orig_input_spec .target ] = (
488
488
original_program .state_dict [orig_input_spec .target ]
489
489
)
490
+ elif (
491
+ orig_input_spec .kind == InputKind .BUFFER
492
+ and orig_input_spec .persistent
493
+ ):
494
+ new_state_dict [orig_input_spec .target ] = (
495
+ original_program .state_dict [orig_input_spec .target ]
496
+ )
497
+ elif orig_input_spec .kind == InputKind .BUFFER :
498
+ assert not orig_input_spec .persistent
499
+ new_constants [orig_input_spec .target ] = original_program .constants [
500
+ orig_input_spec .target
501
+ ]
490
502
elif orig_input_spec .kind in (
491
503
InputKind .CONSTANT_TENSOR ,
492
504
InputKind .CUSTOM_OBJ ,
You can’t perform that action at this time.
0 commit comments