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

Method testOutputShape

tensorflow/python/layers/core_test.py:130–142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128
129 @test_util.run_in_graph_and_eager_modes
130 def testOutputShape(self):
131 dense = core_layers.Dense(7, activation=nn_ops.relu, name='my_dense')
132 inputs = random_ops.random_uniform((5, 3), seed=1)
133 outputs = dense.apply(inputs)
134 self.assertEqual(outputs.get_shape().as_list(), [5, 7])
135
136 inputs = random_ops.random_uniform((5, 2, 3), seed=1)
137 outputs = dense(inputs)
138 self.assertEqual(outputs.get_shape().as_list(), [5, 2, 7])
139
140 inputs = random_ops.random_uniform((1, 2, 4, 3), seed=1)
141 outputs = dense.apply(inputs)
142 self.assertEqual(outputs.get_shape().as_list(), [1, 2, 4, 7])
143
144 @test_util.run_deprecated_v1
145 def testCallOnPlaceHolder(self):

Callers

nothing calls this directly

Calls 5

denseFunction · 0.85
random_uniformMethod · 0.80
applyMethod · 0.45
as_listMethod · 0.45
get_shapeMethod · 0.45

Tested by

no test coverage detected