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

Method _floor_helper

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

Source from the content-addressed store, hash-verified

680 self._ceil_helper(gpu_dev)
681
682 def _floor_helper(self, dev):
683
684 np1 = np.random.random([5, 6, 7, 8]).astype(np.float32)
685
686 np1 = np.random.random([5, 6, 7, 8]).astype(np.float32)
687 np1 = np1 * 10
688 np2 = np.floor(np1)
689
690 t1 = tensor.Tensor(device=dev, data=np1)
691
692 t2_ct = singa_api.Floor(t1.data)
693
694 np.testing.assert_array_almost_equal(
695 tensor.to_numpy(_cTensor_to_pyTensor(t2_ct)), np2)
696
697 def test_floor_cpu(self):
698 self._floor_helper(cpu_dev)

Callers 2

test_floor_cpuMethod · 0.95
test_floor_gpuMethod · 0.95

Calls 2

_cTensor_to_pyTensorFunction · 0.85
TensorMethod · 0.80

Tested by

no test coverage detected