class_docstr: RNNCell wrapper that ensures cell inputs are added to the outputs.
class_docstr_tok: ["RNNCell","wrapper","that","ensures","cell","inputs","are","added","to","the","outputs","."]
docstr: Run the cell and then apply the residual_fn on its inputs to its outputs.
  
  Args:
    inputs: cell inputs.
    state: cell state.
    cell_call_fn: Wrapped cell's method to use for step computation (cell's
      `__call__` or 'call' method).
    **kwargs: Additional arguments passed to the wrapped cell's `call`.
  
  Returns:
    Tuple of cell outputs and new state.
  
  Raises:
    TypeError: If cell inputs and outputs have different structure (type).
    ValueError: If cell inputs and outputs have different structure (value).
docstr_tok: ["Run","the","cell","and","then","apply","the","residual_fn","on","its","inputs","to","its","outputs",".","Args",":","inputs",":","cell","inputs",".","state",":","cell","state",".","cell_call_fn",":","Wrapped","cell","'s","method","to","use","for","step","computation","(","cell's","`","__call__","`","or","'call","'","method",")",".","*","*","kwargs",":","Additional","arguments","passed","to","the","wrapped","cell","'s","`","call","`",".","Returns",":","Tuple","of","cell","outputs","and","new","state",".","Raises",":","TypeError",":","If","cell","inputs","and","outputs","have","different","structure","(","type",")",".","ValueError",":","If","cell","inputs","and","outputs","have","different","structure","(","value",")","."]
code: def _call_wrapped_cell(self, inputs, state, cell_call_fn, **kwargs):
      """Run the cell and then apply the residual_fn on its inputs to its outputs.
  
      Args:
        inputs: cell inputs.
        state: cell state.
        cell_call_fn: Wrapped cell's method to use for step computation (cell's
          `__call__` or 'call' method).
        **kwargs: Additional arguments passed to the wrapped cell's `call`.
  
      Returns:
        Tuple of cell outputs and new state.
  
      Raises:
        TypeError: If cell inputs and outputs have different structure (type).
        ValueError: If cell inputs and outputs have different structure (value).
      """
      outputs, new_state = cell_call_fn(inputs, state, **kwargs)
  
      # Ensure shapes match
      def assert_shape_match(inp, out):
          inp.get_shape().assert_is_compatible_with(out.get_shape())
  
      def default_residual_fn(inputs, outputs):
          nest.assert_same_structure(inputs, outputs)
          nest.map_structure(assert_shape_match, inputs, outputs)
          return nest.map_structure(
              lambda inp, out: inp + out, inputs, outputs
          )
  
      res_outputs = (self._residual_fn or default_residual_fn)(
          inputs, outputs
      )
      return (res_outputs, new_state)
  
imports: import hashlib
  import numbers
  import sys
  import types
  import warnings
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_conversion
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.keras.utils import generic_utils
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.util import nest
label_desc: Use image node_id 5 for calling the ResidualWrapperBase obj's underlying member method code with example usage: obj._call_wrapped_cell(inputs, state, cell_call_fn) and returns: res_outputs,  new_state, nest