code: def test_vs_numpy(backend_tests, custom_args):
      test_idx, f, flag, dim = custom_args
  
      # backend
      be = NervanaObject.be
      dtype = be.default_dtype
  
      # tensors
      tensors = gen_backend_tensors(
          [np, be], [dim] * 5, [flag] * 5, dtype=dtype
      )
  
      # compare function value and gradient
      numpy_func_val = call_func(f, np, tensors[0])
      backend_func_val = call_func(f, be, tensors[1])
  
      try:
          assert tensors_allclose(
              numpy_func_val, backend_func_val, rtol=1e-2, atol=1e-2
          )
      except AssertionError:
          # xfail for gpu backend on TITAN XP platforms
          if isinstance(NervanaObject.be, NervanaGPU):
              if os.getenv("PLATFORM"):
                  platform = os.getenv("PLATFORM")
              else:
                  if os.path.exists("/usr/bin/nvidia-smi"):
                      cmd = "/usr/bin/nvidia-smi -q | grep \"Product Name\" | tail -1 | cut -f 2 -d ':' | \
                             cut -f 2,3 -d ' '"
                      gpu_info = subp.check_output(cmd, shell=True)
                  else:
                      gpu_info = "unknown"
  
              if gpu_info == "TITAN Xp\n":
                  platform = "TITANXP"
  
              if platform == "TITANXP":
                  pytest.xfail(
                      reason="xfail issue #854 with {} PLATFORM".format(
                          platform
                      )
                  )
              else:
                  assert tensors_allclose(
                      numpy_func_val,
                      backend_func_val,
                      rtol=1e-2,
                      atol=1e-2,
                  )
  
file_path: neon/tests/test_backend_compound_optree.py
imports: import itertools
  import numpy
  import os
  import pytest
  import subprocess
  from neon import NervanaObject
  from utils import call_func, gen_backend_tensors, tensors_allclose
label_desc: Use image node_id 3 for calling a global function with example usage: test_vs_numpy(backend_tests, custom_args) without return types