aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python')
-rw-r--r--tensorflow/python/BUILD2
-rw-r--r--tensorflow/python/client/tf_session.i1
-rw-r--r--tensorflow/python/framework/importer_test.py34
-rw-r--r--tensorflow/python/framework/ops.py10
4 files changed, 0 insertions, 47 deletions
diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD
index e6ad564ede..30ecc477f2 100644
--- a/tensorflow/python/BUILD
+++ b/tensorflow/python/BUILD
@@ -3131,8 +3131,6 @@ tf_proto_library(
srcs = ["framework/cpp_shape_inference.proto"],
cc_api_version = 2,
protodeps = tf_additional_all_protos(),
- # TODO(b/74620627): remove when _USE_C_SHAPES is removed
- visibility = ["//tensorflow:internal"],
)
py_test(
diff --git a/tensorflow/python/client/tf_session.i b/tensorflow/python/client/tf_session.i
index 70a3d032f4..e88fc0c01a 100644
--- a/tensorflow/python/client/tf_session.i
+++ b/tensorflow/python/client/tf_session.i
@@ -723,7 +723,6 @@ def TF_Reset(target, containers=None, config=None):
%unignore TF_TryEvaluateConstant_wrapper;
%noexception TF_TryEvaluateConstant_wrapper;
%unignore ExtendSession;
-%unignore ResourceHandleShapeAndType;
%include "tensorflow/python/client/tf_session_helper.h"
diff --git a/tensorflow/python/framework/importer_test.py b/tensorflow/python/framework/importer_test.py
index 369669c2e6..6593b17184 100644
--- a/tensorflow/python/framework/importer_test.py
+++ b/tensorflow/python/framework/importer_test.py
@@ -39,7 +39,6 @@ from tensorflow.python.ops import gradients_impl
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import nn_ops
from tensorflow.python.ops import random_ops
-from tensorflow.python.ops import resource_variable_ops
from tensorflow.python.ops import variables
import tensorflow.python.ops.nn_grad # pylint: disable=unused-import
from tensorflow.python.platform import test
@@ -357,39 +356,6 @@ class ImportGraphDefTest(test.TestCase):
self.assertEqual(d._input_types, [dtypes.int32_ref, dtypes.int32])
self.assertEqual(d.outputs, [])
- def testResources(self):
- # Produce GraphDef containing a ops producing and consuming resources.
- graph = ops.Graph()
- with graph.as_default():
- var = resource_variable_ops.ResourceVariable(1.0)
- var_assign = var.assign(2.0)
- # Use an op that requires handle shape to be set.
- var_shape = resource_variable_ops.variable_shape(var.handle)
- init = variables.global_variables_initializer()
- graph_def = graph.as_graph_def()
-
- # Import the GraphDef.
- with ops.Graph().as_default():
- # pylint: disable=unused-variable
- imported_var, imported_assign, imported_shape, imported_init = (
- importer.import_graph_def(
- graph_def,
- return_elements=[var.name, var_assign.name, var_shape.name,
- init.name]))
-
- # Make sure the handle shape is set on the imported variable.
- new_var_shape = resource_variable_ops.variable_shape(imported_var)
- # pylint: enable=unused-variable
-
- # Run the imported graph.
- # TODO(b/76173421): make this work (currently DCHECKS)
- # with self.test_session() as sess:
- # sess.run(imported_init)
- # self.assertEqual(sess.run(imported_var), 1.0)
- # self.assertEqual(sess.run(imported_assign), 2.0)
- # self.assertEqual(list(sess.run(imported_shape)), [])
- # self.assertEqual(list(sess.run(new_var_shape)), [])
-
def testWhileLoop(self):
# Produce GraphDef containing while loop.
graph = ops.Graph()
diff --git a/tensorflow/python/framework/ops.py b/tensorflow/python/framework/ops.py
index 5e4a884a70..e579289a8d 100644
--- a/tensorflow/python/framework/ops.py
+++ b/tensorflow/python/framework/ops.py
@@ -42,7 +42,6 @@ from tensorflow.python.eager import context
from tensorflow.python.eager import core
from tensorflow.python.eager import tape
from tensorflow.python.framework import c_api_util
-from tensorflow.python.framework import cpp_shape_inference_pb2
from tensorflow.python.framework import device as pydev
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
@@ -296,7 +295,6 @@ class Tensor(_TensorLike):
# Attributes used for C++ shape inference. Not inspected, only forwarded.
# If set, will be a HandleData object from cpp_shape_inference.proto.
- # TODO(b/74620627): remove when _USE_C_SHAPES is removed
self._handle_data = None
self._id = uid()
@@ -2474,14 +2472,6 @@ def _set_shapes_for_outputs_c_api(op):
shape_vector = [None if d == -1 else d for d in shape_vector]
output.set_shape(tensor_shape.TensorShape(shape_vector))
- serialized = c_api.ResourceHandleShapeAndType(op._graph._c_graph,
- output._as_tf_output())
- if serialized:
- output._handle_data = (
- cpp_shape_inference_pb2.CppShapeInferenceResult.HandleData.FromString(
- compat.as_bytes(serialized)))
- else:
- output._handle_data = None
# TODO(skyewm): remove this when _USE_C_API flag is removed.
def _set_shapes_for_outputs(op):