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

Method testCall

tensorflow/python/layers/base_test.py:180–193  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

178
179 @test_util.run_in_graph_and_eager_modes
180 def testCall(self):
181
182 class MyLayer(base_layers.Layer):
183
184 def call(self, inputs):
185 return math_ops.square(inputs)
186
187 layer = MyLayer(name='my_layer')
188 inputs = random_ops.random_uniform((5,), seed=1)
189 outputs = layer.apply(inputs)
190 self.assertEqual(layer.built, True)
191 if not context.executing_eagerly():
192 # op is only supported in GRAPH mode
193 self.assertEqual(outputs.op.name, 'my_layer/Square')
194
195 @test_util.run_in_graph_and_eager_modes
196 def testDeepCopy(self):

Callers

nothing calls this directly

Calls 4

random_uniformMethod · 0.80
executing_eagerlyMethod · 0.80
MyLayerClass · 0.70
applyMethod · 0.45

Tested by

no test coverage detected