aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/losses
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-01-30 11:09:06 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-30 12:39:03 -0800
commit979f139dd94e2bf5fba4794536715973b55373c1 (patch)
tree23557ec1a9b3feb3b16789ad0aa49e9f0ff17441 /tensorflow/contrib/losses
parenta694f0ca2682f53f89a75707ad1f6c2ddffeacde (diff)
Add py2tf to contrib_py.
PiperOrigin-RevId: 183860192
Diffstat (limited to 'tensorflow/contrib/losses')
-rw-r--r--tensorflow/contrib/losses/python/losses/loss_ops_test.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/tensorflow/contrib/losses/python/losses/loss_ops_test.py b/tensorflow/contrib/losses/python/losses/loss_ops_test.py
index 1417772e04..9d0f95e6f3 100644
--- a/tensorflow/contrib/losses/python/losses/loss_ops_test.py
+++ b/tensorflow/contrib/losses/python/losses/loss_ops_test.py
@@ -27,7 +27,6 @@ from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors_impl
from tensorflow.python.framework import ops
from tensorflow.python.framework import random_seed
-from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import math_ops
@@ -275,7 +274,6 @@ class SoftmaxCrossEntropyLossTest(test.TestCase):
self.assertAlmostEqual(np.average(weights) * 10.0, loss, 3)
-@test_util.with_c_api
class SparseSoftmaxCrossEntropyLossTest(test.TestCase):
def testNoneWeightRaisesValueError(self):
@@ -473,11 +471,7 @@ class SparseSoftmaxCrossEntropyLossTest(test.TestCase):
labels = constant_op.constant([[0, 1], [2, 3]])
weights = constant_op.constant([1.2, 3.4, 5.6, 7.8])
- if ops._USE_C_API:
- error_type = ValueError
- else:
- error_type = errors_impl.InvalidArgumentError
- with self.assertRaises(error_type):
+ with self.assertRaises(errors_impl.InvalidArgumentError):
loss_ops.sparse_softmax_cross_entropy(
logits, labels, weights=weights).eval()