code: def test_compute(n_times, test_case):
      mpd = MeanPairwiseDistance()
  
      y_pred, y, batch_size = test_case
  
      mpd.reset()
      if batch_size > 1:
          n_iters = y.shape[0] // batch_size + 1
          for i in range(n_iters):
              idx = i * batch_size
              mpd.update(
                  (
                      y_pred[idx : idx + batch_size],
                      y[idx : idx + batch_size],
                  )
              )
      else:
          mpd.update((y_pred, y))
  
      np_res = np.mean(
          torch.pairwise_distance(
              y_pred, y, p=mpd._p, eps=mpd._eps
          ).numpy()
      )
  
      assert isinstance(mpd.compute(), float)
      assert pytest.approx(mpd.compute()) == np_res
  
imports: import os
  import numpy
  import pytest
  import torch
  import ignite.distributed
  from ignite.exceptions import NotComputableError
  from ignite.metrics import MeanPairwiseDistance
label_desc: Use image node_id 3 for calling a global function with example usage: test_compute(n_times, test_case) without return types