title: Save GAN generated images one by one
body: <p>I have generated some images from the Fashion Mnist dataset, However, I am not able to come up with a function or the way to save each image as a single file. I only have found a way to save them in groups. Can someone help me on how to save images one by one?</p>
  <p>This is what I have for the moment:</p>
  <pre><code>def generate_and_save_images(model, 
       epoch,test_input):
       predictions = model(test_input, training=False)
  
       fig = plt.figure(figsize=(4,4))
  
      for i in range(predictions.shape[0]):
          plt.subplot(4, 4, i+1)
          plt.imshow(predictions[i, :, :, 0] * 127.5 + 
          127.5, cmap='gray')
          plt.axis('off')
  
      plt.savefig('image_at_epoch_{:04d}.png'.format(epoch))
  
      plt.show()
  </code></pre>