MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testCreate

Method testCreate

tensorflow/python/client/session_test.py:101–115  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

99 self.assertAllEqual(result, [[42.0]])
100
101 def testCreate(self):
102 with session.Session():
103 inp = constant_op.constant(10.0, shape=[2, 3], name='W1')
104 copy = array_ops.identity(inp)
105 # Test with feed.
106 # TODO(mrry): Investigate why order='F' didn't work.
107 arr = np.asarray([[0, 1, 2], [3, 4, 5]], dtype=np.float32, order='C')
108 copy_val = copy.eval({'W1:0': arr})
109 self.assertAllEqual(arr, copy_val)
110 # Test without feed.
111 copy_val = copy.eval()
112 self.assertAllEqual(
113 np.asarray(
114 [[10.0, 10.0, 10.0], [10.0, 10.0, 10.0]], dtype=np.float32),
115 copy_val)
116
117 def testManyCPUs(self):
118 with session.Session(

Callers

nothing calls this directly

Calls 5

SessionMethod · 0.45
constantMethod · 0.45
identityMethod · 0.45
evalMethod · 0.45
assertAllEqualMethod · 0.45

Tested by

no test coverage detected