class_docstr: Callback to construct gif of optimized image.
      
class_docstr_tok: ["Callback","to","construct","gif","of","optimized","image","."]
docstr: Args:
      path: The file path to save gif.
      input_range: Specifies the input range as a `(min, max)` tuple.
          This is used to rescale the `wrt_value` passed to `callback` method
          to the given range. (Default value=(0, 255))
docstr_tok: ["Args",":","path",":","The","file","path","to","save","gif",".","input_range",":","Specifies","the","input","range","as","a","`","(","min",",","max",")","`","tuple",".","This","is","used","to","rescale","the","`","wrt_value","`","passed","to","`","callback","`","method","to","the","given","range",".","(","Default","value=","(","0",",","255",")",")"]
code: def __init__(self, path, input_range=(0, 255)):
      """
      Args:
          path: The file path to save gif.
          input_range: Specifies the input range as a `(min, max)` tuple.
              This is used to rescale the `wrt_value` passed to `callback` method
              to the given range. (Default value=(0, 255))
      """
      self.input_range = input_range
      _check_imageio()
      if not path.endswith(".gif"):
          path += ".gif"
      self.writer = imageio.get_writer(path, mode="I", loop=1)
  
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 1 to create a new GifGenerator object from inherited base classes: OptimizerCallback with example: obj = GifGenerator(path, input_range)