add gpt2 padding for tflite
# ❓ Questions & Help

Since tflite requires a fixed input length, how can we correctly add padding for gpt2 input with a fix length so that it won't affect the final result? 

```
import tensorflow as tf
from transformers import *
gpt2_model = TFGPT2LMHeadModel.from_pretrained('distilgpt2')
class WrapModel(tf.keras.models.Model):
    def __init__(self, transformer):
        super(WrapModel, self).__init__()
        self.transformer = transformer

    def call(self, input_ids, **kwargs):
        inputs = {"inputs": input_ids}
        outputs = self.transformer(**inputs)
        next_token_logits = outputs[0][:, -1, :]

        # Greedy decoding
        next_token = tf.math.argmax(next_token_logits, axis=-1, output_type=tf.int32)
        return {"decoded_ids": next_token}

w = WrapModel(gpt2_model)
input_layer = tf.keras.layers.Input(shape=(1, 10), dtype=tf.int32, name='input_ids')
prediction_model = w(input_layer)
tf_model = tf.keras.models.Model(inputs=input_layer, outputs=prediction_model)
export_dir = "./gpt2_tmp/"
tf.keras.models.save_model(tf_model, export_dir)

saved_model_dir = "./gpt2_tmp/"
converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir)
converter.experimental_new_converter = True
converter.optimizations = [tf.lite.Optimize.DEFAULT]
tflite_quant_model = converter.convert()
```

I am not clear how we can use attention_mask to solve this concern based on this one. https://github.com/huggingface/transformers/issues/2630
the latest TF2.3 and tflite can support dynamic input now. Close this.