How does the decoder handle pad encodings without encoder attention mask ? 
I am trying to generate sequence using T5 decoder (not using generate function) by passing encodings and decoder input ids only. However my encoding has pad tokens as well. How is decoder able to handle those pad tokens without passing encoder attention mask. 

Here is my code

input_ids = tokenizer(seq, max_length=1024, padding='max_length', truncation=True, return_tensors="pt")
input_ids=input_ids.to(device)
encoder_output_vectors = model.base_model.encoder(input_ids['input_ids'], return_dict=True)
encodings=encoder_output_vectors.last_hidden_state

#recon is my prompt
decoder_input_ids = tokenizer("recon:", add_special_tokens=False, return_tensors="pt").input_ids
decoder_input_ids=decoder_input_ids.to(device)
decoder_hidden_state = None

    for i in range(max_len):
        with torch.no_grad():
            outputs=model.decoder(input_ids=decoder_input_ids,encoder_hidden_states=encodings)
            
            
        logits=model.lm_head(outputs[0])
        next_decoder_input_ids = torch.argmax(logits[:, -1:], axis=-1)
        decoder_input_ids = torch.cat([decoder_input_ids, next_decoder_input_ids], axis=-1)
        if next_decoder_input_ids == tokenizer.eos_token_id:
            break
                    
        
    rec=tokenizer.decode(decoder_input_ids[0], skip_special_tokens=True)
cc @gante @younesbelkada <|||||>Hey @drkhan107 👋 

The only alternative I see is to fine-tune the model using padded data as input and unpadded data as output, so the model learns to ignore the padding (and that may not work).<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.