提交 7fb82f18 编写于 作者: V Vijay Vasudevan

TensorFlow: merge changes from internal

Base CL: 110018194
上级 0a21a38d
......@@ -237,6 +237,7 @@
* [`sparse_fill_empty_rows`](../../api_docs/python/sparse_ops.md#sparse_fill_empty_rows)
* [`sparse_reorder`](../../api_docs/python/sparse_ops.md#sparse_reorder)
* [`sparse_retain`](../../api_docs/python/sparse_ops.md#sparse_retain)
* [`sparse_split`](../../api_docs/python/sparse_ops.md#sparse_split)
* [`sparse_tensor_to_dense`](../../api_docs/python/sparse_ops.md#sparse_tensor_to_dense)
* [`sparse_to_dense`](../../api_docs/python/sparse_ops.md#sparse_to_dense)
* [`sparse_to_indicator`](../../api_docs/python/sparse_ops.md#sparse_to_indicator)
......
......@@ -401,6 +401,49 @@ then the output will be a `SparseTensor` of shape `[4, 5]` and
* <b>`TypeError`</b>: If `sp_input` is not a `SparseTensor`.
- - -
### `tf.sparse_split(split_dim, num_split, sp_input, name=None)` {#sparse_split}
Split a `SparseTensor` into `num_split` tensors along `split_dim`.
If the `sp_input.shape[split_dim]` is not an integer multiple of `num_split`
each slice starting from 0:`shape[split_dim] % num_split` gets extra one
dimension. For example, if `split_dim = 1` and `num_split = 2` and the
input is:
input_tensor = shape = [2, 7]
[ a d e ]
[b c ]
Graphically the output tensors are:
output_tensor[0] =
[ a ]
[b c ]
output_tensor[1] =
[ d e ]
[ ]
##### Args:
* <b>`split_dim`</b>: A 0-D `int32` `Tensor`. The dimension along which to split.
* <b>`num_split`</b>: A Python integer. The number of ways to split.
* <b>`sp_input`</b>: The `SparseTensor` to split.
* <b>`name`</b>: A name for the operation (optional).
##### Returns:
`num_split` `SparseTensor` objects resulting from splitting `value`.
##### Raises:
* <b>`TypeError`</b>: If `sp_input` is not a `SparseTensor`.
- - -
### `tf.sparse_retain(sp_input, to_retain)` {#sparse_retain}
......
......@@ -1749,7 +1749,7 @@ global_step_tensor = tf.Variable(10, trainable=False, name='global_step')
sess = tf.Session()
# Initializes the variable.
sess.run(global_step_tensor.initializer)
print('global_step:', tf.train.global_step(sess, global_step_tensor))
print('global_step: %s' % tf.train.global_step(sess, global_step_tensor))
global_step: 10
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册