diff --git a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py index 73cfaac0d9f..6b84896bfa1 100644 --- a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py +++ b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py @@ -1198,7 +1198,7 @@ class ControlFlowTest(tf.test.TestCase): with self.test_session(): nums = [1, 2, 3, 4, 5, 6] elems = tf.constant(nums, name="data") - r = control_flow_ops.map( + r = control_flow_ops.map_fn( lambda x: tf.mul(tf.add(x, 3), 2), elems) self.assertAllEqual(np.array([(x + 3) * 2 for x in nums]), r.eval()) diff --git a/tensorflow/python/ops/control_flow_ops.py b/tensorflow/python/ops/control_flow_ops.py index 9e269cc94c8..30918d84c96 100644 --- a/tensorflow/python/ops/control_flow_ops.py +++ b/tensorflow/python/ops/control_flow_ops.py @@ -1885,8 +1885,8 @@ def foldr(fn, elems, initializer=None, name=None): return r_a -def map(fn, elems, dtype=None, name=None): - """The map operator on on the unpacked tensors of a tensor. +def map_fn(fn, elems, dtype=None, name=None): + """The map operator on the unpacked tensors of a tensor. This map operator applies the function `fn` to a sequence of elements from right to left. The elements are made of the tensors unpacked from @@ -1908,7 +1908,7 @@ def map(fn, elems, dtype=None, name=None): Example: ```python elems = [1, 2, 3, 4, 5, 6] - squares = map(lambda x: x * x, elems) + squares = map_fn(lambda x: x * x, elems) ``` """ with ops.op_scope([elems], name, "map") as name: