code: def test_integrated_gradients_model_subclass(
      ffn_model_subclass, method, baselines, kwargs, target_fn, target
  ):
      model = ffn_model_subclass
      ig = IntegratedGradients(
          model, target_fn=target_fn, n_steps=50, method=method
      )
  
      explanations = ig.explain(
          X_test,
          baselines=baselines,
          target=target,
          forward_kwargs=kwargs,
      )
  
      assert isinstance(explanations, Explanation)
      assert (
          explanations["data"]["attributions"][0].shape == X_test.shape
      )
  
      assert "deltas" in explanations["data"].keys()
      assert explanations["data"]["deltas"].shape[0] == X_test.shape[0]
  
      assert "predictions" in explanations["data"].keys()
      assert (
          explanations["data"]["predictions"].shape[0]
          == X_test.shape[0]
      )
  
imports: from functools import partial
  import numpy
  import pytest
  import tensorflow
  from numpy.testing import assert_allclose
  from tensorflow.keras import Model
  from alibi.api.interfaces import Explanation
  from alibi.explainers import IntegratedGradients
  from alibi.explainers.integrated_gradients import _get_target_from_target_fn, _run_forward_from_layer, _run_forward_to_layer, _check_target, _select_target
label_desc: Use image node_id 8 for calling a global function with example usage: test_integrated_gradients_model_subclass(ffn_model_subclass, method, baselines, kwargs, target_fn, target) without return types