hookeai.material_model_finder.utilities.torch_parameters.set_parameter_in_dict

set_parameter_in_dict(param_dict, split_name, value)[source]

Store parameter in torch.nn.ParameterDict.

Provided parameter dictionary is updated in-place. Nested dictionaries are created to handle parameters from nested modules or submodules.

Parameters:
  • param_dict (torch.nn.ParameterDict()) – Parameter dictionary.

  • split_name (list[str]) – Parameter name splitted by dot delimiter (nested structure).

  • value (torch.Tensor(0d)) – Parameter value.