MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / multi_switch_config_context

Function multi_switch_config_context

fastdeploy/model_executor/utils.py:484–497  ·  view source on GitHub ↗

changes: (obj, attr, new_value)

(*changes)

Source from the content-addressed store, hash-verified

482
483@contextmanager
484def multi_switch_config_context(*changes):
485 """
486 changes: (obj, attr, new_value)
487 """
488 originals = []
489 try:
490 for obj, attr, new_value in changes:
491 old_value = getattr(obj, attr)
492 originals.append((obj, attr, old_value))
493 setattr(obj, attr, new_value)
494 yield
495 finally:
496 for obj, attr, old_value in originals:
497 setattr(obj, attr, old_value)
498
499
500def rename_offline_ckpt_suffix_to_fd_suffix(

Callers 3

is_weight_cache_enabledFunction · 0.90
wrapperFunction · 0.90
load_weightsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected