Please refer to GPT2 docs 17. It will give a detailed description of what GPT2Model is supposed to return.
It returns (in order of output):


last_hidden_state  : (batch_size, sequence_length, hidden_size)


past:  (2, batch_size, num_heads, sequence_length, embed_size_per_head)

hidden_states 
attentions