From 678fb5ab8a7df88c6a02a8bd2dde5f0c1d91173e Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Tue, 4 Jun 2019 12:08:21 -0700 Subject: [PATCH] Deprecate alias_inplace_{update,add,sub} ops. Prefer tensor_scatter_nd_{update,add,sub} instead. PiperOrigin-RevId: 251488411 --- tensorflow/python/ops/inplace_ops.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tensorflow/python/ops/inplace_ops.py b/tensorflow/python/ops/inplace_ops.py index a6b6f7a28b4..7d4c32e3233 100644 --- a/tensorflow/python/ops/inplace_ops.py +++ b/tensorflow/python/ops/inplace_ops.py @@ -24,6 +24,7 @@ from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import gen_array_ops from tensorflow.python.ops import math_ops +from tensorflow.python.util import deprecation def _inplace_helper(x, i, v, op): @@ -63,6 +64,10 @@ def _inplace_helper(x, i, v, op): return op(x, i, v) +@deprecation.deprecated( + None, + ('Prefer tf.tensor_scatter_nd_update, which offers the same functionality ' + 'with well-defined read-write semantics.')) def alias_inplace_update(x, i, v): """Applies an inplace update on input x at index i with value v. Aliases x. @@ -85,6 +90,10 @@ def alias_inplace_update(x, i, v): return _inplace_helper(x, i, v, gen_array_ops.inplace_update) +@deprecation.deprecated( + None, + ('Prefer tf.tensor_scatter_nd_add, which offers the same functionality ' + 'with well-defined read-write semantics.')) def alias_inplace_add(x, i, v): """Applies an inplace add on input x at index i with value v. Aliases x. @@ -107,6 +116,10 @@ def alias_inplace_add(x, i, v): return _inplace_helper(x, i, v, gen_array_ops.inplace_add) +@deprecation.deprecated( + None, + ('Prefer tf.tensor_scatter_nd_sub, which offers the same functionality ' + 'with well-defined read-write semantics.')) def alias_inplace_sub(x, i, v): """Applies an inplace sub on input x at index i with value v. Aliases x. @@ -148,6 +161,10 @@ def empty_like(x, init=None): return gen_array_ops.empty(array_ops.shape(x), x.dtype, init=init) +@deprecation.deprecated( + None, + ('Prefer tf.tensor_scatter_nd_update, which offers the same functionality ' + 'with well-defined read-write semantics.')) def inplace_update(x, i, v): """Applies an inplace update on input x at index i with value v. @@ -174,6 +191,10 @@ def inplace_update(x, i, v): return alias_inplace_update(gen_array_ops.deep_copy(x), i, v) +@deprecation.deprecated( + None, + ('Prefer tf.tensor_scatter_nd_add, which offers the same functionality ' + 'with well-defined read-write semantics.')) def inplace_add(x, i, v): """Applies an inplace add on input x at index i with value v. @@ -200,6 +221,10 @@ def inplace_add(x, i, v): return alias_inplace_add(gen_array_ops.deep_copy(x), i, v) +@deprecation.deprecated( + None, + ('Prefer tf.tensor_scatter_nd_sub, which offers the same functionality ' + 'with well-defined read-write semantics.')) def inplace_sub(x, i, v): """Applies an inplace sub on input x at index i with value v.