From ad4323e93479caf12a11b6e089174be2a7ec7462 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Thu, 7 May 2020 17:34:50 +0000 Subject: [PATCH] Update tf.map_fn to specify that at least one tensor must be present Signed-off-by: Yong Tang Typo fix Signed-off-by: Yong Tang --- tensorflow/python/ops/map_fn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/ops/map_fn.py b/tensorflow/python/ops/map_fn.py index 6f59bcf5599..287070af07c 100644 --- a/tensorflow/python/ops/map_fn.py +++ b/tensorflow/python/ops/map_fn.py @@ -267,7 +267,7 @@ def map_fn(fn, elems: A tensor or (possibly nested) sequence of tensors, each of which will be unstacked along their first dimension. `fn` will be applied to the nested sequence of the resulting slices. `elems` may include ragged and - sparse tensors. + sparse tensors. `elems` must consist of at least one tensor. dtype: Deprecated: Equivalent to `fn_output_signature`. parallel_iterations: (optional) The number of iterations allowed to run in parallel. When graph building, the default value is 10. While executing @@ -296,7 +296,7 @@ def map_fn(fn, TypeError: if `fn` is not callable or the structure of the output of `fn` and `fn_output_signature` do not match. ValueError: if the lengths of the output of `fn` and `fn_output_signature` - do not match. + do not match, or if the `elems` does not contain any tensor. Examples: