diff options
author | Skye Wanderman-Milne <skyewm@google.com> | 2018-03-13 16:31:14 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-03-13 17:16:37 -0700 |
commit | 39dc589ad5ffccef4caeb099588d8e33d181ca6c (patch) | |
tree | 13b079f16cfce8bf110de94312e93d9078a16317 /tensorflow/contrib/framework | |
parent | a20c9fb63ef1eeabbe439b5a13aa29deaca44861 (diff) |
Introduce _USE_C_SHAPES toggle along with _USE_C_API toggle.
This is a second level of staging before fully enabling the C
API. With _USE_C_API enabled but _USE_C_SHAPES disabled, the C API is
used for everything but retrieving the shape of Tensors (i.e. we
continue using the existing Python shape inference to implement
Tensor.shape).
This is useful because many tests fail with the C API fully
enabled. This will allow us to enable everything but the full shape
inference, fix the remaining broken tests, and then enable the full
shape shape inference.
This change also introduces the test_util.enable_c_shapes test method
decorator. This can be used to enable C shapes for a specific test
method. This is useful for tests that have already been modified to
work with full C shape inference.
PiperOrigin-RevId: 188949619
Diffstat (limited to 'tensorflow/contrib/framework')
-rw-r--r-- | tensorflow/contrib/framework/python/framework/tensor_util_test.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/contrib/framework/python/framework/tensor_util_test.py b/tensorflow/contrib/framework/python/framework/tensor_util_test.py index 8cdb340f2d..a2834b6489 100644 --- a/tensorflow/contrib/framework/python/framework/tensor_util_test.py +++ b/tensorflow/contrib/framework/python/framework/tensor_util_test.py @@ -209,6 +209,7 @@ class WithShapeTest(test.TestCase): self.assertRaisesRegexp(errors_impl.OpError, "Wrong shape", tensor_2x2.eval, {tensor_no_shape: [42.0]}) + @test_util.enable_c_shapes def test_with_shape_partial(self): with self.test_session(): tensor_partial_shape = array_ops.placeholder(dtypes.float32) |