MCPcopy Create free account
hub / github.com/apache/singa / _ceil_helper

Method _ceil_helper

test/python/test_api.py:660–673  ·  view source on GitHub ↗
(self, dev)

Source from the content-addressed store, hash-verified

658 self._concat_helper(gpu_dev)
659
660 def _ceil_helper(self, dev):
661
662 np1 = np.random.random([5, 6, 7, 8]).astype(np.float32)
663
664 np1 = np.random.random([5, 6, 7, 8]).astype(np.float32)
665 np1 = np1 * 10
666 np2 = np.ceil(np1)
667
668 t1 = tensor.Tensor(device=dev, data=np1)
669
670 t2_ct = singa_api.Ceil(t1.data)
671
672 np.testing.assert_array_almost_equal(
673 tensor.to_numpy(_cTensor_to_pyTensor(t2_ct)), np2)
674
675 def test_ceil_cpu(self):
676 self._ceil_helper(cpu_dev)

Callers 2

test_ceil_cpuMethod · 0.95
test_ceil_gpuMethod · 0.95

Calls 2

_cTensor_to_pyTensorFunction · 0.85
TensorMethod · 0.80

Tested by

no test coverage detected