def _check_share_hidden_layers_sizes(self) -> None:
    if self.component_config.get(SHARE_HIDDEN_LAYERS):
        first_hidden_layer_sizes = next(iter(self.component_config[HIDDEN_LAYERS_SIZES].values()))
        identical_hidden_layer_sizes = all(((current_hidden_layer_sizes == first_hidden_layer_sizes) for current_hidden_layer_sizes in self.component_config[HIDDEN_LAYERS_SIZES].values()))
        if (not identical_hidden_layer_sizes):
            raise ValueError(f'If hidden layer weights are shared, {HIDDEN_LAYERS_SIZES} must coincide.')
def _check_share_hidden_layers_sizes(self) -> None:
    if self.component_config.get(SHARE_HIDDEN_LAYERS):
        first_hidden_layer_sizes = next(iter(self.component_config[HIDDEN_LAYERS_SIZES].values()))
        identical_hidden_layer_sizes = all(((current_hidden_layer_sizes == first_hidden_layer_sizes) for current_hidden_layer_sizes in self.component_config[HIDDEN_LAYERS_SIZES].values()))
        if (not identical_hidden_layer_sizes):
            raise ValueError(f'If hidden layer weights are shared, {HIDDEN_LAYERS_SIZES} must coincide.')