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

Method _Exp_helper

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

Source from the content-addressed store, hash-verified

642 self._Mean_helper(gpu_dev)
643
644 def _Exp_helper(self, dev):
645 X = np.array([0.8, -1.2, 3.3, -3.6, -0.5,
646 0.5]).reshape(3, 2).astype(np.float32)
647 XT = np.exp(X)
648 x = tensor.from_numpy(X)
649 x.to_device(dev)
650
651 result = autograd.exp(x)
652 dx = result.creator.backward(x.data)
653
654 np.testing.assert_array_almost_equal(tensor.to_numpy(result),
655 XT,
656 decimal=5)
657 self.check_shape(dx.shape(), (3, 2))
658
659 def test_Exp_cpu(self):
660 self._Exp_helper(cpu_dev)

Callers 2

test_Exp_cpuMethod · 0.95
test_Exp_gpuMethod · 0.95

Calls 5

check_shapeMethod · 0.95
shapeMethod · 0.80
reshapeMethod · 0.45
to_deviceMethod · 0.45
backwardMethod · 0.45

Tested by

no test coverage detected