code: def test_non_trainable_model_objective() -> None:
      """
      Checks that we can still compute the objective of a model that has no
      trainable parameters whatsoever (regression test for bug in log_prior()).
      In this case we have no priors, so log_prior should be zero to add no
      contribution to the objective.
      """
      model = gpflow.models.GPR(
          (Data.X, Data.Y),
          kernel=gpflow.kernels.SquaredExponential(
              lengthscales=Data.ls, variance=Data.var
          ),
      )
  
      set_trainable(model, False)
  
      _ = model.log_marginal_likelihood()
      assert model.log_prior_density() == 0.0
  
imports: import numpy
  import tensorflow
  import gpflow
  from gpflow import set_trainable
label_desc: Use image node_id 1 for calling a global function with example usage: test_non_trainable_model_objective() without return types