Delete unused graph_zeros_like

PiperOrigin-RevId: 272987722
This commit is contained in:
Gaurav Jain 2019-10-04 17:05:33 -07:00 committed by TensorFlower Gardener
parent 67b984d683
commit b67bd9ec7f
2 changed files with 1 additions and 22 deletions

View File

@ -25,20 +25,6 @@ from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
def graph_zeros_like(tensor):
"""Graph-only version of tf.zeros_like(), for internal use only."""
g = ops._get_graph_from_inputs([tensor]) # pylint: disable=protected-access
with g.as_default(), ops.name_scope(None, "zeros_like", [tensor]) as name:
tensor = ops.convert_to_tensor(tensor, name="tensor")
dtype = tensor.dtype.base_dtype
dtype_value = attr_value_pb2.AttrValue(type=dtype.as_datatype_enum)
op = g._create_op_internal( # pylint: disable=protected-access
"ZerosLike", [tensor], [dtype], input_types=[dtype],
attrs={"T": dtype_value}, name=name)
result, = op.outputs
return result
def graph_placeholder(dtype, shape, name=None):
"""Graph-only version of tf.compat.v1.placeholder(), for internal use only."""
dtype = dtype.base_dtype

View File

@ -29,14 +29,7 @@ from tensorflow.python.platform import test
class GraphOnlyOpsTest(test_util.TensorFlowTestCase):
@test_util.run_deprecated_v1
def testGraphZerosLike(self):
x = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.int32)
z_tf = graph_only_ops.graph_zeros_like(x)
with self.cached_session():
self.assertAllClose(np.zeros((2, 3)), self.evaluate(z_tf))
@test_util.run_deprecated_v1
@test_util.deprecated_graph_mode_only
def testGraphPlaceholder(self):
x_tf = graph_only_ops.graph_placeholder(dtypes.int32, shape=(1,))
y_tf = math_ops.square(x_tf)