def _check_input_dimension_consistency(self, model_data: RasaModelData) -> None:
    'Checks if features have same dimensionality if hidden layers are shared.'
    if self.component_config.get(SHARE_HIDDEN_LAYERS):
        num_text_sentence_features = model_data.number_of_units(TEXT, SENTENCE)
        num_label_sentence_features = model_data.number_of_units(LABEL, SENTENCE)
        num_text_sequence_features = model_data.number_of_units(TEXT, SEQUENCE)
        num_label_sequence_features = model_data.number_of_units(LABEL, SEQUENCE)
        if ((0 < num_text_sentence_features != num_label_sentence_features > 0) or (0 < num_text_sequence_features != num_label_sequence_features > 0)):
            raise ValueError('If embeddings are shared text features and label features must coincide. Check the output dimensions of previous components.')
Checks if features have same dimensionality if hidden layers are shared.
def _check_input_dimension_consistency(self, model_data: RasaModelData) -> None:
    
    if self.component_config.get(SHARE_HIDDEN_LAYERS):
        num_text_sentence_features = model_data.number_of_units(TEXT, SENTENCE)
        num_label_sentence_features = model_data.number_of_units(LABEL, SENTENCE)
        num_text_sequence_features = model_data.number_of_units(TEXT, SEQUENCE)
        num_label_sequence_features = model_data.number_of_units(LABEL, SEQUENCE)
        if ((0 < num_text_sentence_features != num_label_sentence_features > 0) or (0 < num_text_sequence_features != num_label_sequence_features > 0)):
            raise ValueError('If embeddings are shared text features and label features must coincide. Check the output dimensions of previous components.')