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

Method testRange

tensorflow/python/ops/nn_test.py:1077–1092  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1075class LeakyReluTest(test_lib.TestCase):
1076
1077 def testRange(self):
1078 batch_size = 3
1079 height, width = 4, 4
1080 np.random.seed(1) # Make it reproducible.
1081 inputs = np.random.uniform(size=(batch_size, height, width, 3)).astype(
1082 np.float32)
1083 inputs = constant_op.constant(inputs)
1084
1085 outputs = nn_ops.leaky_relu(inputs)
1086 self.assertEquals(inputs.shape, outputs.shape)
1087
1088 inputs, outputs = self.evaluate([inputs, outputs])
1089
1090 self.assertGreaterEqual(outputs.min(), 0.0)
1091 self.assertLessEqual(outputs.max(), 1.0)
1092 self.assertAllClose(inputs, outputs)
1093
1094 @test_util.run_deprecated_v1
1095 def testValues(self):

Callers

nothing calls this directly

Calls 8

uniformMethod · 0.80
assertEqualsMethod · 0.80
seedMethod · 0.45
constantMethod · 0.45
evaluateMethod · 0.45
minMethod · 0.45
maxMethod · 0.45
assertAllCloseMethod · 0.45

Tested by

no test coverage detected