code: def test_compute(n_times, test_case):
      mse = MeanSquaredError()
  
      y_pred, y, batch_size = test_case
  
      mse.reset()
      if batch_size > 1:
          n_iters = y.shape[0] // batch_size + 1
          for i in range(n_iters):
              idx = i * batch_size
              mse.update(
                  (
                      y_pred[idx : idx + batch_size],
                      y[idx : idx + batch_size],
                  )
              )
      else:
          mse.update((y_pred, y))
  
      np_y = y.numpy()
      np_y_pred = y_pred.numpy()
  
      np_res = np.power((np_y - np_y_pred), 2.0).sum() / np_y.shape[0]
  
      assert isinstance(mse.compute(), float)
      assert mse.compute() == np_res
  
imports: import os
  import numpy
  import pytest
  import torch
  import ignite.distributed
  from ignite.exceptions import NotComputableError
  from ignite.metrics import MeanSquaredError
label_desc: Use image node_id 3 for calling a global function with example usage: test_compute(n_times, test_case) without return types