```
type or paste code here
# parameters
BATCH_SIZE = 64
N_STEPS = 28
N_INPUTS = 28
N_NEURONS = 150
N_OUTPUTS = 10
N_EPHOCS = 10
class ImageRNN(nn.Module):
def __init__(self, batch_size, n_steps, n_inputs, n_neurons, n_outputs):
super(ImageRNN, self).__init__()
self.n_neurons = n_neurons
self.batch_size = batch_size
self.n_steps = n_steps
self.n_inputs = n_inputs
self.n_outputs = n_outputs
self.basic_rnn = nn.RNN(self.n_inputs, self.n_neurons)
self.FC = nn.Linear(self.n_neurons, self.n_outputs)
def init_hidden(self,):
# (num_layers, batch_size, n_neurons)
return (torch.zeros(1, self.batch_size, self.n_neurons))
def forward(self, X):
# transforms X to dimensions: n_steps X batch_size X n_inputs
X = X.permute(1, 0, 2)
self.batch_size = X.size(1)
self.hidden = self.init_hidden()
# lstm_out => n_steps, batch_size, n_neurons (hidden states for each time step)
# self.hidden => 1, batch_size, n_neurons (final state from each lstm_out)
lstm_out, self.hidden = self.basic_rnn(X, self.hidden)
out = self.FC(self.hidden)
return out.view(-1, self.n_outputs) # batch_size X n_output
dataiter = iter(trainloader)
images, labels = dataiter.next()
model = ImageRNN(BATCH_SIZE, N_STEPS, N_INPUTS, N_NEURONS, N_OUTPUTS)
logits = model(images.view(-1, 28,28))
print(logits.size())
print(logits[0:10])
```

Can anyone explain the working of of 1,0,2 in line X = X.permute(1, 0, 2) and what is logits,why am I getting the size of logits as 64,10.

I’m B.Tech final year student. Im trying to explore RNN for image classification. Can anyone help me in understanding the working of X = X.permute(1, 0, 2) in the above code.