epochs = 10
steps_per_epoch = len(input_tensor)//batch_size
for epoch in range(epochs):
start = time.time()
encoding_hidden = encoder.initialize_hidden_state()
total_loss = 0
for(batch,(inp,targ)) in enumerate(
train_dataset.take(steps_per_epoch)):
batch_loss = train_step(inp,targ,encoding_hidden)
total_loss += batch_loss
if batch % 100 == 0:
print('Epoch {} batch {} loss {:.4f}'.format(
epoch+1,batch,batch_loss.numpy()))
print('Epoch {} Loss {:.4f}'.format(epoch+1,total_loss/steps_per_epoch))
print('Time take for 1 epoch {} second\n'.format(time.time() - start))