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

Method _Less_helper

test/python/test_operation.py:1133–1147  ·  view source on GitHub ↗
(self, dev)

Source from the content-addressed store, hash-verified

1131 self._Atanh_helper(gpu_dev)
1132
1133 def _Less_helper(self, dev):
1134 x0 = np.array([-0.9, -0.3, -0.1, 0.1, 0.5,
1135 0.9]).reshape(3, 2).astype(np.float32)
1136 x1 = np.array([0, -0.3, 0, 0.1, 0, 0.9]).reshape(3,
1137 2).astype(np.float32)
1138 y = np.less(x0, x1)
1139 x0 = tensor.from_numpy(x0)
1140 x1 = tensor.from_numpy(x1)
1141 x0.to_device(dev)
1142 x1.to_device(dev)
1143
1144 result = autograd.less(x0, x1)
1145 np.testing.assert_array_almost_equal(tensor.to_numpy(result),
1146 y,
1147 decimal=5)
1148
1149 def test_Less_cpu(self):
1150 self._Less_helper(cpu_dev)

Callers 2

test_Less_cpuMethod · 0.95
test_Less_gpuMethod · 0.95

Calls 2

reshapeMethod · 0.45
to_deviceMethod · 0.45

Tested by

no test coverage detected