code: def test_integration_median_relative_absolute_error_with_output_transform():
      np.random.seed(1)
      size = 105
      np_y_pred = np.random.rand(size, 1)
      np_y = np.random.rand(size, 1)
      np.random.shuffle(np_y)
      np_median_absolute_relative_error = np.median(
          np.abs(np_y - np_y_pred) / np.abs(np_y - np_y.mean())
      )
  
      batch_size = 15
  
      def update_fn(engine, batch):
          idx = (engine.state.iteration - 1) * batch_size
          y_true_batch = np_y[idx : idx + batch_size]
          y_pred_batch = np_y_pred[idx : idx + batch_size]
          return torch.from_numpy(y_pred_batch), torch.from_numpy(
              y_true_batch
          )
  
      engine = Engine(update_fn)
  
      m = MedianRelativeAbsoluteError()
      m.attach(engine, "median_absolute_relative_error")
  
      data = list(range(size // batch_size))
      median_absolute_relative_error = engine.run(
          data, max_epochs=1
      ).metrics["median_absolute_relative_error"]
  
      assert np_median_absolute_relative_error == pytest.approx(
          median_absolute_relative_error
      )
  
imports: import os
  import numpy
  import pytest
  import torch
  import ignite.distributed
  from ignite.contrib.metrics.regression import MedianRelativeAbsoluteError
  from ignite.engine import Engine
  from ignite.exceptions import NotComputableError
label_desc: Use image node_id 5 for calling a global function with example usage: test_integration_median_relative_absolute_error_with_output_transform() and returns: torch,  torch