class_docstr: Convenience class for analyzers that revert the model's structure.
  
  This class contains many helper functions around the graph
  reverse function :func:`innvestigate.backend.graph.reverse_model`.
  
  The deriving classes should specify how the graph should be reverted
  by implementing the following functions:
  
  * :func:`_reverse_mapping(layer)` given a layer this function
    returns a reverse mapping for the layer as specified in
    :func:`innvestigate.backend.graph.reverse_model` or None.
  
    This function can be implemented, but it is encouraged to
    implement a default mapping and add additional changes with
    the function :func:`_add_conditional_reverse_mapping` (see below).
  
    The default behavior is finding a conditional mapping (see below),
    if none is found, :func:`_default_reverse_mapping` is applied.
  * :func:`_default_reverse_mapping` defines the default
    reverse mapping.
  * :func:`_head_mapping` defines how the outputs of the model
    should be instantiated before the are passed to the reversed
    network.
  
  Furthermore other parameters of the function
  :func:`innvestigate.backend.graph.reverse_model` can
  be changed by setting the according parameters of the
  init function:
  
  :param reverse_verbose: Print information on the reverse process.
  :param reverse_clip_values: Clip the values that are passed along
    the reverted network. Expects tuple (min, max).
  :param reverse_project_bottleneck_layers: Project the value range
    of bottleneck tensors in the reverse network into another range.
  :param reverse_check_min_max_values: Print the min/max values
    observed in each tensor along the reverse network whenever
    :func:`analyze` is called.
  :param reverse_check_finite: Check if values passed along the
    reverse network are finite.
  :param reverse_keep_tensors: Keeps the tensors created in the
    backward pass and stores them in the attribute
    :attr:`_reversed_tensors`.
  :param reverse_reapply_on_copied_layers: See
    :func:`innvestigate.backend.graph.reverse_model`.
docstr: This function should return a reverse mapping for the passed layer.
  
  If this function returns None, :func:`_default_reverse_mapping`
  is applied.
  
  :param layer: The layer for which a mapping should be returned.
  :return: The mapping can be of the following forms:
    * A function of form (A) f(Xs, Ys, reversed_Ys, reverse_state)
      that maps reversed_Ys to reversed_Xs (which should contain
      tensors of the same shape and type).
    * A function of form f(B) f(layer, reverse_state) that returns
      a function of form (A).
    * A :class:`ReverseMappingBase` subclass.
docstr_tok: ["This","function","should","return","a","reverse","mapping","for","the","passed","layer",".","If","this","function","returns","None",",",":","func",":","`","_default_reverse_mapping","`","is","applied",".",":","param","layer",":","The","layer","for","which","a","mapping","should","be","returned",".",":","return",":","The","mapping","can","be","of","the","following","forms",":","*","A","function","of","form","(","A",")","f","(","Xs",",","Ys",",","reversed_Ys",",","reverse_state",")","that","maps","reversed_Ys","to","reversed_Xs","(","which","should","contain","tensors","of","the","same","shape","and","type",")",".","*","A","function","of","form","f","(","B",")","f","(","layer",",","reverse_state",")","that","returns","a","function","of","form","(","A",")",".","*","A",":","class",":","`","ReverseMappingBase","`","subclass","."]
code: def _reverse_mapping(self, layer: Layer):
      """
      This function should return a reverse mapping for the passed layer.
  
      If this function returns None, :func:`_default_reverse_mapping`
      is applied.
  
      :param layer: The layer for which a mapping should be returned.
      :return: The mapping can be of the following forms:
        * A function of form (A) f(Xs, Ys, reversed_Ys, reverse_state)
          that maps reversed_Ys to reversed_Xs (which should contain
          tensors of the same shape and type).
        * A function of form f(B) f(layer, reverse_state) that returns
          a function of form (A).
        * A :class:`ReverseMappingBase` subclass.
      """
      if layer in self._special_helper_layers:
          # Special layers added by AnalyzerNetworkBase
          # that should not be exposed to user.
          return self._gradient_reverse_mapping
  
      return self._apply_conditional_reverse_mappings(layer)
  
imports: from __future__ import annotations
  from typing import Callable
  import numpy
  import tensorflow.keras.backend
  import innvestigate.backend
  import innvestigate.backend.graph
  import innvestigate.layers
  from innvestigate.analyzer.network_base import AnalyzerNetworkBase
  from innvestigate.backend.types import CondReverseMapping, Layer, Model, OptionalList, ReverseTensorDict, Tensor
label_desc: Use image node_id 3 for calling the ReverseAnalyzerBase obj's underlying member method code with example usage: obj._reverse_mapping(layer) and returns: self, self