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

Method _round

test/python/test_api.py:895–899  ·  view source on GitHub ↗
(self, dev=gpu_dev)

Source from the content-addressed store, hash-verified

893 self._round(gpu_dev)
894
895 def _round(self, dev=gpu_dev):
896 x = tensor.Tensor(shape=(3,4,5), device=dev).gaussian(0, 1)
897 y = tensor._call_singa_func(singa_api.Round, x.data)
898 np.testing.assert_array_almost_equal(np.round(tensor.to_numpy(x)),
899 tensor.to_numpy(y))
900
901 def test_round_even_cpu(self):
902 self._round_even(cpu_dev)

Callers 2

test_round_cpuMethod · 0.95
test_round_gpuMethod · 0.95

Calls 2

TensorMethod · 0.80
gaussianMethod · 0.45

Tested by

no test coverage detected