code: def test_compute_model_performance_multitask_regressor():
      random_seed = 42
      n_data_points = 20
      n_features = 2
      n_tasks = 2
      np.random.seed(seed=random_seed)
  
      X = np.random.rand(n_data_points, n_features)
      y1 = np.array([0.5 for x in range(n_data_points)])
      y2 = np.array([-0.5 for x in range(n_data_points)])
      y = np.stack([y1, y2], axis=1)
      dataset = NumpyDataset(X, y)
  
      features = layers.Input(shape=(n_features,))
      dense = layers.Dense(n_tasks)(features)
      keras_model = tf.keras.Model(inputs=features, outputs=[dense])
      model = dc.models.KerasModel(
          keras_model, dc.models.losses.L2Loss(), learning_rate=0.1
      )
  
      model.fit(dataset, nb_epoch=1000)
      metric = [
          dc.metrics.Metric(
              dc.metrics.mean_absolute_error, np.mean, mode="regression"
          ),
      ]
      scores = model.evaluate_generator(
          model.default_generator(dataset),
          metric,
          per_task_metrics=True,
      )
      scores = list(scores[1].values())
      assert np.all(np.isclose(scores, [0.0, 0.0], atol=1.0))
  
file_path: deepchem/deepchem/utils/test/test_generator_evaluator.py
imports: import numpy
  from flaky import flaky
  import pytest
  import deepchem
  from deepchem.data import NumpyDataset
label_desc: Use image node_id 3 for calling a global function with example usage: test_compute_model_performance_multitask_regressor() without return types