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

Method _not_helper

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

Source from the content-addressed store, hash-verified

2000 self._or_helper(gpu_dev)
2001
2002 def _not_helper(self, dev):
2003 x = np.array([1.0, -1.0, 0, -0.1, 0,
2004 -7.0]).reshape(3, 2).astype(np.float32)
2005
2006 y = np.logical_not(x)
2007 x = tensor.from_numpy(x)
2008 x.to_device(dev)
2009
2010 result = autograd._not(x)
2011
2012 np.testing.assert_array_almost_equal(tensor.to_numpy(result),
2013 y,
2014 decimal=5)
2015
2016 def test_not_cpu(self):
2017 self._not_helper(cpu_dev)

Callers 2

test_not_cpuMethod · 0.95
test_not_gpuMethod · 0.95

Calls 2

reshapeMethod · 0.45
to_deviceMethod · 0.45

Tested by

no test coverage detected