Hello guys I m trying to understand how to make a forward pass on an encoder decoder model with a custom dataset.
I have created a BucketIterator to see how the tensor.shape looks like for a batch of size 64.
train_iterator, valid_iterator, test_iterator = BucketIterator.splits(
(train_data, valid_data, test_data),
batch_size=batch_size,
sort_within_batch=True,
sort_key=lambda x: len(x.src),
device=device,
)
I was expecting the tensor to have the shape(64,sequence length) but it is the opposit
tensor shape
From my inderstanding if I have a batch of 64 I should process 64 sentences. So shouldn’t i have 64 vectors with the input_ids in them that have the length equal with the max_length?
I am pretty new to this I would really apreciate if you could explain me a little bit.
I have tried to look and read about the tensor shapes and how it works but from my understanding it should be like I described earlier =>(64,15) number of batch size vector with max_length values that represents the numerical representation of tokens.
Zaharie Andrei is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.