marks ={'Physics':67,'Maths':87}
internal_marks ={'Practical':48}
marks.update(internal_marks)print(marks)#Output:{'Physics':67,'Maths':87,'Practical':48}
model_state_dict, optimizer_state_dict =loader(os.path.join(checkpoint_floder, config["model_loadname"]))
model_dict = model.state_dict()
model_state_dict ={k: v for k, v in model_state_dict.items()if k in model_dict}
model_dict.update(model_state_dict)
model.load_state_dict(model_state_dict)