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

Method testDynamicNoiseShape

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

Source from the content-addressed store, hash-verified

418
419 @test_util.run_in_graph_and_eager_modes
420 def testDynamicNoiseShape(self):
421 inputs = array_ops.ones((5, 3, 2))
422 noise_shape = [None, 1, None]
423 dp = core_layers.Dropout(0.5, noise_shape=noise_shape, seed=1)
424 dropped = dp.apply(inputs, training=True)
425 self.evaluate(variables.global_variables_initializer())
426 np_output = self.evaluate(dropped)
427 self.assertAlmostEqual(0., np_output.min())
428 self.assertAllClose(np_output[:, 0, :], np_output[:, 1, :])
429
430 def testCustomNoiseShape(self):
431 inputs = array_ops.ones((5, 3, 2))

Callers

nothing calls this directly

Calls 5

onesMethod · 0.80
applyMethod · 0.45
evaluateMethod · 0.45
minMethod · 0.45
assertAllCloseMethod · 0.45

Tested by

no test coverage detected