code: def test_not_trainable_model_error_tf():
      """Test non-trainable model error `tensorflow`."""
  
      model = keras.Sequential([keras.layers.Dense(1, use_bias=False)])
      # GradientSimilarity method checks weights are trainable so we need to build the model before passing it to the
      # method
      model.build((None, 2))
      model.trainable = False
      with pytest.raises(ValueError) as err:
          GradientSimilarity(
              model,
              task="regression",
              loss_fn=loss_tf,
              sim_fn="grad_dot",
              backend="tensorflow",
          )
      assert err.value.args[0] == (
          "The model has no trainable weights. This method requires at least "
          "one trainable parameter to compute the gradients for. "
          "Set ``trainable=True`` on the model or a model weight."
      )
  
imports: import pytest
  import numpy
  import torch.nn
  import torch
  import tensorflow
  from tensorflow import keras
  from alibi.explainers.similarity.grad import GradientSimilarity
label_desc: Use image node_id 19 for calling a global function with example usage: test_not_trainable_model_error_tf() without return types