class_docstr: All Feature classes extend this class to implement custom visualizations in
  Insights.
  
  It enforces child classes to implement ``visualization_type`` and ``visualize``
  methods.
class_docstr_tok: ["All","Feature","classes","extend","this","class","to","implement","custom","visualizations","in","Insights",".","It","enforces","child","classes","to","implement","``","visualization_type","``","and","``","visualize","``","methods","."]
docstr: Args:
  
      name (str): The label of the specific feature. For example, an
                  ImageFeature's name can be "Photo".
      baseline_transforms (list, Callable, optional): Optional list of
                  callables (e.g. functions) to be called on the input tensor
                  to construct multiple baselines. Currently only one baseline
                  is supported. See
                  :py:class:`.IntegratedGradients` for more
                  information about baselines.
      input_transforms (list, Callable, optional): Optional list of callables
                  (e.g. functions) called on the input tensor sequentially to
                  convert it into the format expected by the model.
      visualization_transform (Callable, optional): Optional callable (e.g.
                  function) applied as a postprocessing step of the original
                  input data (before ``input_transforms``) to convert it to a
                  format to be understood by the frontend visualizer as
                  specified in ``captum/captum/insights/frontend/App.js``.
docstr_tok: ["Args",":","name","(","str",")",":","The","label","of","the","specific","feature",".","For","example",",","an","ImageFeature","'s","name","can","be","``","Photo","''",".","baseline_transforms","(","list",",","Callable",",","optional",")",":","Optional","list","of","callables","(","e.g",".","functions",")","to","be","called","on","the","input","tensor","to","construct","multiple","baselines",".","Currently","only","one","baseline","is","supported",".","See",":","py",":","class",":","`",".IntegratedGradients","`","for","more","information","about","baselines",".","input_transforms","(","list",",","Callable",",","optional",")",":","Optional","list","of","callables","(","e.g",".","functions",")","called","on","the","input","tensor","sequentially","to","convert","it","into","the","format","expected","by","the","model",".","visualization_transform","(","Callable",",","optional",")",":","Optional","callable","(","e.g",".","function",")","applied","as","a","postprocessing","step","of","the","original","input","data","(","before","``","input_transforms","``",")","to","convert","it","to","a","format","to","be","understood","by","the","frontend","visualizer","as","specified","in","``","captum\/captum\/insights\/frontend\/App.js","``","."]
code: def __init__(
      self,
      name: str,
      baseline_transforms: Optional[Union[Callable, List[Callable]]],
      input_transforms: Optional[Union[Callable, List[Callable]]],
      visualization_transform: Optional[Callable],
  ) -> None:
      r"""
      Args:
  
          name (str): The label of the specific feature. For example, an
                      ImageFeature's name can be "Photo".
          baseline_transforms (list, Callable, optional): Optional list of
                      callables (e.g. functions) to be called on the input tensor
                      to construct multiple baselines. Currently only one baseline
                      is supported. See
                      :py:class:`.IntegratedGradients` for more
                      information about baselines.
          input_transforms (list, Callable, optional): Optional list of callables
                      (e.g. functions) called on the input tensor sequentially to
                      convert it into the format expected by the model.
          visualization_transform (Callable, optional): Optional callable (e.g.
                      function) applied as a postprocessing step of the original
                      input data (before ``input_transforms``) to convert it to a
                      format to be understood by the frontend visualizer as
                      specified in ``captum/captum/insights/frontend/App.js``.
      """
      self.name = name
      self.baseline_transforms = format_transforms(baseline_transforms)
      self.input_transforms = format_transforms(input_transforms)
      self.visualization_transform = visualization_transform
  
imports: import base64
  import warnings
  from collections import namedtuple
  from io import BytesIO
  from typing import Callable, List, Optional, Union
  from captum._utils.common import safe_div
  from captum.attr._utils import visualization
  from captum.insights.attr_vis._utils.transforms import format_transforms
label_desc: Use image node_id 1 to create a new BaseFeature object  with example: obj = BaseFeature(name, baseline_transforms, input_transforms, visualization_transform)