code: def assertTensorEqual(x, y, decimal=6):
      assert x.shape == y.shape
      assert x.dtype == y.dtype
      assert x.device.id() == y.device.id()
      d = x.device
      x.to_host()
      y.to_host()
      np.testing.assert_array_almost_equal(
          x.data.GetFloatValue(int(x.size())),
          y.data.GetFloatValue(int(y.size())),
          decimal,
      )
      x.to_device(d)
      y.to_device(d)
  
imports: from __future__ import division
  import math
  import unittest
  import numpy
  import functools
  from singa import tensor
  from singa import singa_wrap
  from singa import opt
  from cuda_helper import gpu_dev, cpu_dev
label_desc: Use image node_id 1 for calling a global function with example usage: assertTensorEqual(x, y, decimal) without return types