Hi I am pretty much new too pytorch and try to do sentimental analysis.
My Input data is
array([[ 0,  0,  0,  0,  0,  0,  0,  0,  0,  5,  8]
[ 0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  1],
[ 0,  0,  0,  0,  0,  0,  9,  5,  1,  6,  7],
[ 0,  0,  0,  0,  9,  5,  1,  6,  7, 16, 17],
[ 0,  0,  0,  0,  0,  0,  2,  1,  3, 10,  4],
[ 2,  1,  3, 10,  4, 18, 19, 20, 21, 22, 23],
[11,  1,  6,  7, 24, 12,  5,  1, 13, 25, 26],
[ 2,  2,  2,  2,  8,  3,  3,  3,  4,  4,  4],
[ 0,  0,  0,  0,  0,  0,  0, 14,  1, 27, 14],
[ 0, 11,  1, 15,  2, 28, 12, 13, 15,  3,  4]]
Output Data
tensor([1., 0., 1., 1., 0., 0., 1., 0., 0., 1.]) where 1 is pos and 0 is neg review.
My Model

class RNN(nn.Module):
def init(self,n_vocab,n_embed,hidden_size):
super().init()
self.hidden_size = hidden_size
self.embedding = nn.Embedding(n_vocab+1,n_embed)
self.rnn = nn.RNN(n_embed, hidden_size, num_layers = 1, batch_first = True)
def forward(self,x):
x = x
x = self.embedding(x) # batch-size x seq_length x embedding_dimension
x,_ =self.rnn(x)   #batch-size x seq_length x hidden_size
x = torch.sigmoid(x[:,:,-1][:,-1])
return x


n_vocab = len(char_to_int) ## 28
n_embed = 100
hidden_size = 8
model = RNN(n_vocab,n_embed, hidden_size)

I just Need to know that the indexing I did at last is correct or not (x = torch.sigmoid(x[:,:,-1][:,-1])).
Sorry for such a Naive question.