code: def ewise_ref_data(topi_name, dtype):
      config = ewise_operations[topi_name]
  
      input_range = config["input_range"]
      shape = config.get("shape", (20, 3))
  
      a_np = np.random.uniform(*input_range, size=shape).astype(dtype)
  
      if dtype.startswith("float"):
          if config.get("replace_with_nan", False):
              a_np.ravel()[
                  np.random.choice(
                      a_np.size, int(a_np.size * 0.5), replace=False
                  )
              ] = np.nan
          if config.get("replace_with_inf", False):
              a_np.ravel()[
                  np.random.choice(
                      a_np.size, int(a_np.size * 0.5), replace=False
                  )
              ] = np.infty
  
      # avoid round check too close to boundary
      if topi_name == "round":
          a_np += ((np.abs(np.fmod(a_np, 1)) - 0.5) < 1e-6) * 1e-4
  
      b_np = config["ref"](a_np)
  
      if config.get("cast_output", False):
          b_np = b_np.astype(dtype)
  
      return a_np, b_np
  
file_path: tvm/tests/python/topi/test_topi_math.py
imports: import sys
  import numpy
  import pytest
  import scipy
  from scipy import special
  import tvm
  import tvm.testing
  import tvm.topi.testing
  from tvm import te, topi
  from tvm.topi import utils
label_desc: Use image node_id 2 for calling a global function with example usage: ewise_ref_data(topi_name, dtype) and returns: a_np,  b_np