def testLargeCase(self):
    shape = [32, 512, 256, 1]
    predictions = random_ops.random_uniform(shape, 0.0, 1.0, dtype=dtypes_lib.float32)
    labels = math_ops.greater(random_ops.random_uniform(shape, 0.0, 1.0), 0.5)
    (result, update_op) = metric_ops.precision_recall_at_equal_thresholds(labels=labels, predictions=predictions, num_thresholds=201)
    num_updates = 71
    with self.cached_session() as sess:
        sess.run(variables.local_variables_initializer())
        for _ in xrange(num_updates):
            sess.run(update_op)
        prdata = sess.run(result)
        expected_value = ((1.0 * np.product(shape)) * num_updates)
        got_value = (prdata.tp[0] + prdata.fp[0])
        self.assertNear(got_value, expected_value, 1.0)
def testLargeCase(self):
    shape = [32, 512, 256, 1]
    predictions = random_ops.random_uniform(shape, 0.0, 1.0, dtype=dtypes_lib.float32)
    labels = math_ops.greater(random_ops.random_uniform(shape, 0.0, 1.0), 0.5)
    (result, update_op) = metric_ops.precision_recall_at_equal_thresholds(labels=labels, predictions=predictions, num_thresholds=201)
    num_updates = 71
    with self.cached_session() as sess:
        sess.run(variables.local_variables_initializer())
        for _ in xrange(num_updates):
            sess.run(update_op)
        prdata = sess.run(result)
        expected_value = ((1.0 * np.product(shape)) * num_updates)
        got_value = (prdata.tp[0] + prdata.fp[0])
        self.assertNear(got_value, expected_value, 1.0)