src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py/TFSpeech2TextSinusoidalPositionalEmbedding/call
class TFSpeech2TextSinusoidalPositionalEmbedding:    def call(self, input_ids: tf.Tensor, past_key_values_length: int = 0) -> tf.Tensor:
        bsz, seq_len = shape_list(input_ids)
        # Create the position ids from the input token ids. Any padded tokens remain padded.
        position_ids = self.create_position_ids_from_input_ids(input_ids, self.padding_idx, past_key_values_length)

        # expand embeddings if needed
        max_pos = self.padding_idx + 1 + seq_len
        if max_pos > shape_list(self.embeddings)[0]:
            self.embedding_weights = self._get_embedding(max_pos + self.offset, self.embedding_dim, self.padding_idx)
            self.embeddings.assign(self.embedding_weights)
        return tf.reshape(tf.gather(self.embeddings, tf.reshape(position_ids, (-1,)), axis=0), (bsz, seq_len, -1))