Text-Classification-Pytorch
Text-Classification-Pytorch copied to clipboard
Use of permute in RCNN
On lines 63 and 73 of Text-Classification-Pytorch/models/RCNN.py
, function permute
is used.
input = input.permute(1, 0, 2) # input.size() = (num_sequences, batch_size, embedding_length)
...
y = y.permute(0, 2, 1) # y.size() = (batch_size, hidden_size, num_sequences)
Could you please explain why it is necessary or useful to permute the dimensions of these tensors?