Why is the input a tuple?

In exercise 06 (implement the next symbol function) of C4_W2_Assignment, why is it that the, “…model expects a tuple containing two padded tensors (with batch)” at the output, _ = model((None, None) line? From the overall model architecture, it seems to me that the second element of the tuple is not used at all in any of the model computation steps and is simply outputted as is. Is my understanding correct? If so, is this because Trax always expects a tuple as the model input? Tnx.

I presume this is so because the model takes tuples when it performs training (one with the entire text, the other with the summary, see def preprocess in cell 5). As the model structure is the same during training and prediction, it requires a tuple for prediction.

2 Likes

Ok, tnx for your reply.