Hi,
Thank you for your reply. I am already trying to do through for loop, as follow:
for epoch in range(args.num_epochs):
print “epoch” + str(epoch)
for i in range (0,int(dataset_train),args.batch_size):
# Forward, Backward and Optimize
RNN.zero_grad()
for b in range(i,i+args.batch_size):
inp,sg = get_input(dataset[i]) # inp=torch.cat((s1,sg))
for l in range(0,len(targets)):
inp=to_var(inp)
outputs = RNN(inp)
inp=torch.cat((sg,outputs))
loss = criterion(outputs,targets[l])
loss.backward()
optimizer.step()
But it tells to give the input in the form (seq_length, batch, input_size).