code: def calc_approx_error(
      expected_tensor: np.ndarray, observed_tensor: np.ndarray
  ) -> float:
      """
      Calculating relative error for one tensor
      """
      error = observed_tensor - expected_tensor
      absolute_error = np.abs(error)
      mean_absolute_error = absolute_error.mean()
      mean_expected_value = np.abs(expected_tensor).mean()
      error = mean_absolute_error / mean_expected_value
      return error
  
file_path: gluon-nlp/docs/model_zoo/question_answering/custom_strategy.py
imports: import copy
  import numpy
  from collections import OrderedDict
  from neural_compressor.strategy.strategy import TuneStrategy, strategy_registry
label_desc: Use image node_id 1 for calling a global function with example usage: calc_approx_error(expected_tensor, observed_tensor) and returns: error