Pytorch, Pytorch Rnn, Pytorch Mnist Dataset, Build Model With Pytorch.
print(f"labels: {labels}") images = images.reshape(-1, sequence_length, input_size).to(device) labels = labels.to(device) print(f"images after reshpae: {images}") # Forward pass outputs = model(images) loss = loss_func(outputs, labels) # Backward and optimize optimizer.zero_grad() loss.backward()