MCPcopy Index your code
hub / github.com/openai/improved-diffusion / master_params_to_model_params

Function master_params_to_model_params

improved_diffusion/fp16_util.py:50–61  ·  view source on GitHub ↗

Copy the master parameter data back into the model parameters.

(model_params, master_params)

Source from the content-addressed store, hash-verified

48
49
50def master_params_to_model_params(model_params, master_params):
51 """
52 Copy the master parameter data back into the model parameters.
53 """
54 # Without copying to a list, if a generator is passed, this will
55 # silently not copy any parameters.
56 model_params = list(model_params)
57
58 for param, master_param in zip(
59 model_params, unflatten_master_params(model_params, master_params)
60 ):
61 param.detach().copy_(master_param)
62
63
64def unflatten_master_params(model_params, master_params):

Callers 1

optimize_fp16Method · 0.85

Calls 1

unflatten_master_paramsFunction · 0.85

Tested by

no test coverage detected