code: def compare_tensors(func, inputs, outputs, deriv=False, tol=0.0):
      be = NervanaObject.be
      temp = be.empty(outputs.shape)
      dtypeu = np.float32
      if deriv is True:
          temp[:] = func.bprop(be.array(dtypeu(inputs)))
      else:
          temp[:] = func(be.array(dtypeu(inputs)))
      cond = np.sum(np.abs(temp.get() - outputs) <= tol)
      assert cond == np.prod(outputs.shape)
  
imports: from math import tanh
  import numpy
  from neon import NervanaObject
  from neon.transforms import Identity, Rectlin, Softmax, Tanh, Logistic, Sign, PixelwiseSoftmax
  from utils import allclose_with_out
label_desc: Use image node_id 1 for calling a global function with example usage: compare_tensors(func, inputs, outputs, deriv, tol) without return types