code: def test_fast_two_layers():
      model = kmodels.Sequential(
          [
              klayers.Dense(2, input_shape=(3,), use_bias=False),
              klayers.Dense(2, use_bias=False),
          ]
      )
      weights = [
          np.asarray(((1, 2), (3, 4), (5, 6))),
          np.asarray(((7, 8), (9, 1))),
      ]
      model.set_weights(weights)
  
      inputs = np.asarray((1, 2, 3)).reshape((1, 3))
      outputs = model.predict_on_batch(inputs)
  
      analyzer = Gradient(model)
      analysis = analyzer.analyze(inputs)
  
      # Analyzer takes node with max output.
      i = np.argmax(outputs)
      gradient_middle = np.dot(
          weights[1][:, i], np.ones_like(outputs[0][i])
      )
      gradient = np.dot(weights[0], gradient_middle)
      assert np.allclose(analysis, gradient)
  
file_path: innvestigate/tests/backend/test_layer.py
imports: from __future__ import annotations
  import numpy
  import pytest
  import tensorflow.keras.layers
  import tensorflow.keras.models
  import innvestigate.layers
  from innvestigate.analyzer.gradient_based import Gradient
label_desc: Use image node_id 4 for calling a global function with example usage: test_fast_two_layers() without return types