shaped_params = []
for param in params:
data = np.asarray(param.get("data"))
shape = tuple(param.get("shape"))
shaped_params.append(data.reshape(shape))
base_layer.set_weights(shaped_params)
return base_layer
After Change
def container_from_config(original_layer_dict):
layer_dict = copy.deepcopy(original_layer_dict)
name = layer_dict.get("name")
if name == "Merge":
mode = layer_dict.get("mode")