class_docstr: Callback to construct gif of optimized image.
      
class_docstr_tok: ["Callback","to","construct","gif","of","optimized","image","."]
code: def callback(self, i, named_losses, overall_loss, grads, wrt_value):
      img = utils.deprocess_input(wrt_value[0])
      # If range has integer numbers, cast to 'uint8'
      if (
          self.input_range is not None
          and isinstance(self.input_range[0], int)
          and isinstance(self.input_range[1], int)
      ):
          img = np.clip(
              img, self.input_range[0], self.input_range[1]
          ).astype("uint8")
      img = utils.draw_text(img, "Step {}".format(i + 1))
      self.writer.append_data(img)
  
file_path: keras-vis/vis/callbacks.py
imports: from __future__ import absolute_import
  import pprint
  import numpy
  from .utils import utils
label_desc: Use image node_id 2 for calling the GifGenerator obj's underlying member method code with example usage: obj.callback(i, named_losses, overall_loss, grads, wrt_value) without return types