class_docstr: Combines multiple dense or sparse feature tensors into one.
  
  This layer combines features by following these steps:
  1. Apply a `ConcatenateSparseDenseFeatures` layer separately to sequence- and
      sentence-level features, yielding two tensors (one for each feature type).
  2. Concatenate the sequence- and sentence-level tensors along the sequence dimension
      by appending sentence-level features at the first available token position after
      the sequence-level (token-level) features.
  
  Arguments:
      attribute: Name of attribute (e.g. `text` or `label`) whose features will be
          processed.
      attribute_signature: A dictionary containing two lists of feature signatures,
          one for each feature type (`sequence` or `sentence`) of the given attribute.
      config: A model config used for correctly parameterising the layer and the
          `ConcatenateSparseDenseFeatures` layer it uses internally.
  
  Input shape:
      Tuple of three input tensors:
          sequence_features: List of 3-D dense or sparse tensors, each with shape
              `(batch_size, max_seq_length, input_dim)` where `input_dim` can be
              different for sparse vs dense tensors. See the input shape of
              `ConcatenateSparseDenseFeatures` for more information.
          sentence_features: List of 3-D dense or sparse tensors, each with shape
              `(batch_size, 1, input_dim)` where `input_dim` can be different for
              sparse vs dense tensors, and can differ from that in
              `sequence_features`. See the input shape of
              `ConcatenateSparseDenseFeatures` for more information.
          sequence_feature_lengths: Dense tensor of shape `(batch_size, )`.
  
  Output shape:
      combined_features: A 3-D tensor with shape `(batch_size, sequence_length,
          units)` where `units` is  completely  determined by the internally applied
          `ConcatenateSparseDenseFeatures` layer and `sequence_length` is the combined
          length of sequence- and sentence-level features: `max_seq_length + 1` if
          both feature types are present, `max_seq_length` if only sequence-level
          features are present, and 1 if only sentence-level features are present).
      mask_combined_sequence_sentence: A 3-D tensor with shape
          `(batch_size, sequence_length, 1)`.
  
  Raises:
      A `TFLayerConfigException` if no feature signatures are provided.
  
  Attributes:
      output_units: The last dimension size of the layer's `combined_features` output.
class_docstr_tok: ["Combines","multiple","dense","or","sparse","feature","tensors","into","one",".","This","layer","combines","features","by","following","these","steps",":","1",".","Apply","a","`","ConcatenateSparseDenseFeatures","`","layer","separately","to","sequence-","and","sentence-level","features",",","yielding","two","tensors","(","one","for","each","feature","type",")",".","2",".","Concatenate","the","sequence-","and","sentence-level","tensors","along","the","sequence","dimension","by","appending","sentence-level","features","at","the","first","available","token","position","after","the","sequence-level","(","token-level",")","features",".","Arguments",":","attribute",":","Name","of","attribute","(","e.g",".","`","text","`","or","`","label","`",")","whose","features","will","be","processed",".","attribute_signature",":","A","dictionary","containing","two","lists","of","feature","signatures",",","one","for","each","feature","type","(","`","sequence","`","or","`","sentence","`",")","of","the","given","attribute",".","config",":","A","model","config","used","for","correctly","parameterising","the","layer","and","the","`","ConcatenateSparseDenseFeatures","`","layer","it","uses","internally",".","Input","shape",":","Tuple","of","three","input","tensors",":","sequence_features",":","List","of","3-D","dense","or","sparse","tensors",",","each","with","shape","`","(","batch_size",",","max_seq_length",",","input_dim",")","`","where","`","input_dim","`","can","be","different","for","sparse","vs","dense","tensors",".","See","the","input","shape","of","`","ConcatenateSparseDenseFeatures","`","for","more","information",".","sentence_features",":","List","of","3-D","dense","or","sparse","tensors",",","each","with","shape","`","(","batch_size",",","1",",","input_dim",")","`","where","`","input_dim","`","can","be","different","for","sparse","vs","dense","tensors",",","and","can","differ","from","that","in","`","sequence_features","`",".","See","the","input","shape","of","`","ConcatenateSparseDenseFeatures","`","for","more","information",".","sequence_feature_lengths",":","Dense","tensor","of","shape","`","(","batch_size",",",")","`",".","Output","shape",":","combined_features",":","A","3-D","tensor","with","shape","`","(","batch_size",",","sequence_length",",","units",")","`","where","`","units","`","is","completely","determined","by","the","internally","applied","`","ConcatenateSparseDenseFeatures","`","layer","and","`","sequence_length","`","is","the","combined","length","of","sequence-","and","sentence-level","features",":","`","max_seq_length","+","1","`","if","both","feature","types","are","present",",","`","max_seq_length","`","if","only","sequence-level","features","are","present",",","and","1","if","only","sentence-level","features","are","present",")",".","mask_combined_sequence_sentence",":","A","3-D","tensor","with","shape","`","(","batch_size",",","sequence_length",",","1",")","`",".","Raises",":","A","`","TFLayerConfigException","`","if","no","feature","signatures","are","provided",".","Attributes",":","output_units",":","The","last","dimension","size","of","the","layer","'s","`","combined_features","`","output","."]
docstr: Sets up combining sentence- and sequence-level features (if needed).
  
  This boils down to preparing for unifying the units of the sequence- and
  sentence-level features if they differ -- the same number of units is required
  for combining the features.
docstr_tok: ["Sets","up","combining","sentence-","and","sequence-level","features","(","if","needed",")",".","This","boils","down","to","preparing","for","unifying","the","units","of","the","sequence-","and","sentence-level","features","if","they","differ","--","the","same","number","of","units","is","required","for","combining","the","features","."]
code: def _prepare_sequence_sentence_concat(
      self, attribute: Text, config: Dict[Text, Any]
  ) -> None:
      """Sets up combining sentence- and sequence-level features (if needed).
  
      This boils down to preparing for unifying the units of the sequence- and
      sentence-level features if they differ -- the same number of units is required
      for combining the features.
      """
      if (
          self._feature_types_present[SEQUENCE]
          and self._feature_types_present[SENTENCE]
      ):
          # The output units of this layer will be based on the output sizes of the
          # sparse+dense combining layers that are internally applied to all features.
          sequence_units = self._tf_layers[
              f"sparse_dense.{SEQUENCE}"
          ].output_units
          sentence_units = self._tf_layers[
              f"sparse_dense.{SENTENCE}"
          ].output_units
  
          # Last dimension needs to be unified if sequence- and sentence-level
          # features have different sizes, e.g. due to being produced by different
          # featurizers.
          if sequence_units != sentence_units:
              for feature_type in [SEQUENCE, SENTENCE]:
                  self._tf_layers[
                      f"unify_dims_before_seq_sent_concat.{feature_type}"
                  ] = layers.Ffnn(
                      layer_name_suffix=f"unify_dims.{attribute}_{feature_type}",
                      layer_sizes=[config[CONCAT_DIMENSION][attribute]],
                      dropout_rate=config[DROP_RATE],
                      reg_lambda=config[REGULARIZATION_CONSTANT],
                      density=config[CONNECTION_DENSITY],
                  )
  
imports: import tensorflow
  import numpy
  from typing import Text, List, Dict, Any, Union, Optional, Tuple, Callable
  from rasa.shared.nlu.constants import TEXT
  from rasa.utils.tensorflow.model_data import FeatureSignature
  from rasa.utils.tensorflow.constants import REGULARIZATION_CONSTANT, CONNECTION_DENSITY, NUM_TRANSFORMER_LAYERS, TRANSFORMER_SIZE, NUM_HEADS, UNIDIRECTIONAL_ENCODER, KEY_RELATIVE_ATTENTION, VALUE_RELATIVE_ATTENTION, MAX_RELATIVE_POSITION, MASKED_LM, HIDDEN_LAYERS_SIZES, DROP_RATE, SPARSE_INPUT_DROPOUT, DENSE_INPUT_DROPOUT, DENSE_DIMENSION, CONCAT_DIMENSION, DROP_RATE_ATTENTION, SEQUENCE, SENTENCE
  from rasa.utils.tensorflow import layers
  from rasa.utils.tensorflow.exceptions import TFLayerConfigException
  from rasa.utils.tensorflow.transformer import TransformerEncoder
  from rasa.nlu.constants import DEFAULT_TRANSFORMER_SIZE
label_desc: Use image node_id 4 for calling the RasaFeatureCombiningLayer obj's underlying member method code with example usage: obj._prepare_sequence_sentence_concat(attribute, config) without return types