diff options
Diffstat (limited to 'tensorflow/python/ops/array_ops.py')
-rw-r--r-- | tensorflow/python/ops/array_ops.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tensorflow/python/ops/array_ops.py b/tensorflow/python/ops/array_ops.py index 361667ec49..a917f51087 100644 --- a/tensorflow/python/ops/array_ops.py +++ b/tensorflow/python/ops/array_ops.py @@ -538,7 +538,7 @@ def slice(input_, begin, size, name=None): words, `begin[i]` is the offset into the 'i'th dimension of `input` that you want to slice from. - Note that @{tf.Tensor.__getitem__} is typically a more pythonic way to + Note that `tf.Tensor.__getitem__` is typically a more pythonic way to perform slices, as it allows you to write `foo[3:7, :-2]` instead of `tf.slice(foo, [3, 0], [4, foo.get_shape()[1]-2])`. @@ -594,7 +594,7 @@ def strided_slice(input_, **Instead of calling this op directly most users will want to use the NumPy-style slicing syntax (e.g. `tensor[..., 3:4:-1, tf.newaxis, 3]`), which - is supported via @{tf.Tensor.__getitem__} and @{tf.Variable.__getitem__}.** + is supported via `tf.Tensor.__getitem__` and `tf.Variable.__getitem__`.** The interface of this op is a low-level encoding of the slicing syntax. Roughly speaking, this op extracts a slice of size `(end-begin)/stride` @@ -636,10 +636,10 @@ def strided_slice(input_, `foo[:4, tf.newaxis, :2]` would produce a shape `(4, 1, 2)` tensor. If the ith bit of `shrink_axis_mask` is set, it implies that the ith - specification shrinks the dimensionality by 1. `begin[i]`, `end[i]` and - `strides[i]` must imply a slice of size 1 in the dimension. For example in - Python one might do `foo[:, 3, :]` which would result in - `shrink_axis_mask` equal to 2. + specification shrinks the dimensionality by 1, taking on the value at index + `begin[i]`. `end[i]` and `strides[i]` are ignored in this case. For example in + Python one might do `foo[:, 3, :]` which would result in `shrink_axis_mask` + equal to 2. NOTE: `begin` and `end` are zero-indexed. @@ -723,7 +723,7 @@ def _SliceHelperVar(var, slice_spec): """Creates a slice helper object given a variable. This allows creating a sub-tensor from part of the current contents - of a variable. See @{tf.Tensor.__getitem__} for detailed examples + of a variable. See `tf.Tensor.__getitem__` for detailed examples of slicing. This function in addition also allows assignment to a sliced range. |