class_docstr: Abstract data generator.
class_docstr_tok: ["Abstract","data","generator","."]
docstr: Pad data of different lengths.
  
  Sequential data is padded with zeros. Zeros are added to the end of data.
  
  Args:
      array_of_dense: The array to pad.
  
  Returns:
      The padded array.
docstr_tok: ["Pad","data","of","different","lengths",".","Sequential","data","is","padded","with","zeros",".","Zeros","are","added","to","the","end","of","data",".","Args",":","array_of_dense",":","The","array","to","pad",".","Returns",":","The","padded","array","."]
code: def _pad_dense_data(array_of_dense: FeatureArray) -> np.ndarray:
      """Pad data of different lengths.
  
      Sequential data is padded with zeros. Zeros are added to the end of data.
  
      Args:
          array_of_dense: The array to pad.
  
      Returns:
          The padded array.
      """
      if array_of_dense.number_of_dimensions == 4:
          return RasaDataGenerator._pad_4d_dense_data(array_of_dense)
  
      if array_of_dense[0].ndim < 2:
          # data doesn't contain a sequence
          return array_of_dense.astype(np.float32)
  
      data_size = len(array_of_dense)
      max_seq_len = max([x.shape[0] for x in array_of_dense])
  
      data_padded = np.zeros(
          [data_size, max_seq_len, array_of_dense[0].shape[-1]],
          dtype=array_of_dense[0].dtype,
      )
      for i in range(data_size):
          data_padded[
              i, : array_of_dense[i].shape[0], :
          ] = array_of_dense[i]
  
      return data_padded.astype(np.float32)
  
imports: import math
  from typing import List, Union, Text, Optional, Any, Tuple, Dict, cast
  import logging
  import scipy.sparse
  import numpy
  from tensorflow.keras.utils import Sequence
  from rasa.utils.tensorflow.constants import SEQUENCE, BALANCED
  from rasa.utils.tensorflow.model_data import RasaModelData, Data, FeatureArray
label_desc: Use image node_id 7 for calling the RasaDataGenerator obj's underlying member method code with example usage: obj._pad_dense_data(array_of_dense) and returns: data_padded, RasaDataGenerator, array_of_dense