Text-Classification-Pytorch icon indicating copy to clipboard operation
Text-Classification-Pytorch copied to clipboard

Use of permute in RCNN

Open jtquisenberry opened this issue 4 years ago • 0 comments

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?

jtquisenberry avatar Jan 04 '21 21:01 jtquisenberry