I am trying to implement multiclass classification using RNN. There are 9 categories  say: ‘GRASS’,‘POLISH’…,etc.
How to give true input in criterion loss?
loss1 = criterion(output,true)

Should the true labels in criterion be one hot encoding? OR just the number like 0,1,2…!
Should the the argmax be taken for output?

num_classes = 9
num_epochs = 2
batch_size = 1
learning_rate = 0.001

input_size = embeded_train.shape[2]
sequence_length = embeded_train.shape[1]
hidden_size = 128
num_layers = 1
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

class RNN(nn.Module):
    def __init__(self, input_size, hidden_size, num_layers, num_classes):
        super(RNN, self).__init__()
        self.num_layers = num_layers
        self.hidden_size = hidden_size
        self.rnn = nn.RNN(input_size, hidden_size, num_layers, batch_first=True)
        self.fc = nn.Linear(hidden_size, num_classes)
        
    def forward(self, x):
        h0 = torch.zeros(self.num_layers, x.size(0), self.hidden_size).to(device) 
        out, _ = self.rnn(x, h0)  
        out = out[:, -1, :]
        out1 = self.fc(out)
        return out1

model = RNN(input_size, hidden_size, num_layers, num_classes).to(device)
criterion = nn.CrossEntropyLoss()
optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate)

for epoch in range(num_epochs):
  for i in range(0,input_size):
    input = embeded_train[i].reshape(-1, 84, 300).to(device)
    output = model(input)
    loss1 = criterion(output,l)