diff options
author | 2016-06-30 14:25:47 -0800 | |
---|---|---|
committer | 2016-06-30 15:34:19 -0700 | |
commit | d3067c338425bdf97fa782d834399b89bce18309 (patch) | |
tree | 501887d5ac5f346c1161845cee2460288da582f5 | |
parent | 605aa53d2bb65a8a38dc72725e28ebe75a949d5a (diff) |
Update generated Python Op docs.
Change: 126350719
6 files changed, 206 insertions, 88 deletions
diff --git a/tensorflow/g3doc/api_docs/python/contrib.framework.md b/tensorflow/g3doc/api_docs/python/contrib.framework.md index 4c23455597..df4df30d19 100644 --- a/tensorflow/g3doc/api_docs/python/contrib.framework.md +++ b/tensorflow/g3doc/api_docs/python/contrib.framework.md @@ -227,50 +227,49 @@ adds them via `tf.add_n`. - - - -### `tf.contrib.framework.safe_embedding_lookup_sparse(embedding_weights, sparse_ids, sparse_weights=None, combiner='mean', default_id=None, name=None, partition_strategy='div')` {#safe_embedding_lookup_sparse} - -Lookup embedding results, accounting for invalid IDs and empty features. - -The partitioned embedding in `embedding_weights` must all be the same shape -except for the first dimension. The first dimension is allowed to vary as the -vocabulary size is not necessarily a multiple of `P`. - -Invalid IDs (< 0) are pruned from input IDs and weights, as well as any IDs -with non-positive weight. For an entry with no features, the embedding vector -for `default_id` is returned, or the 0-vector if `default_id` is not supplied. - -The ids and weights may be multi-dimensional. Embeddings are always aggregated -along the last dimension. - -##### Args: - - -* <b>`embedding_weights`</b>: A list of `P` float tensors or values representing - partitioned embedding tensors. The total unpartitioned shape should be - `[e_0, e_1, ..., e_m]`, where `e_0` represents the vocab size and - `e_1, ..., e_m` are the embedding dimensions. -* <b>`sparse_ids`</b>: `SparseTensor` of shape `[d_0, d_1, ..., d_n]` containing the - ids. `d_0` is typically batch size. -* <b>`sparse_weights`</b>: `SparseTensor` of same shape as `sparse_ids`, containing - float weights corresponding to `sparse_ids`, or `None` if all weights - are be assumed to be 1.0. -* <b>`combiner`</b>: A string specifying how to combine embedding results for each - entry. Currently "mean", "sqrtn" and "sum" are supported, with "mean" - the default. -* <b>`default_id`</b>: The id to use for an entry with no features. -* <b>`name`</b>: A name for this operation (optional). -* <b>`partition_strategy`</b>: A string specifying the partitioning strategy. - Currently `"div"` and `"mod"` are supported. Default is `"div"`. - - -##### Returns: - - Dense tensor of shape `[d_0, d_1, ..., d_{n-1}, e_1, ..., e_m]`. - -##### Raises: - - -* <b>`ValueError`</b>: if `embedding_weights` is empty. +### `tf.contrib.framework.safe_embedding_lookup_sparse(*args, **kwargs)` {#safe_embedding_lookup_sparse} + +Lookup embedding results, accounting for invalid IDs and empty features. (deprecated) + +THIS FUNCTION IS DEPRECATED. It will be removed after 2016-09-01. +Instructions for updating: +Please use tf.contrib.layers.safe_embedding_lookup_sparse. + + The partitioned embedding in `embedding_weights` must all be the same shape + except for the first dimension. The first dimension is allowed to vary as the + vocabulary size is not necessarily a multiple of `P`. + + Invalid IDs (< 0) are pruned from input IDs and weights, as well as any IDs + with non-positive weight. For an entry with no features, the embedding vector + for `default_id` is returned, or the 0-vector if `default_id` is not supplied. + + The ids and weights may be multi-dimensional. Embeddings are always aggregated + along the last dimension. + + Args: + embedding_weights: A list of `P` float tensors or values representing + partitioned embedding tensors. The total unpartitioned shape should be + `[e_0, e_1, ..., e_m]`, where `e_0` represents the vocab size and + `e_1, ..., e_m` are the embedding dimensions. + sparse_ids: `SparseTensor` of shape `[d_0, d_1, ..., d_n]` containing the + ids. `d_0` is typically batch size. + sparse_weights: `SparseTensor` of same shape as `sparse_ids`, containing + float weights corresponding to `sparse_ids`, or `None` if all weights + are be assumed to be 1.0. + combiner: A string specifying how to combine embedding results for each + entry. Currently "mean", "sqrtn" and "sum" are supported, with "mean" + the default. + default_id: The id to use for an entry with no features. + name: A name for this operation (optional). + partition_strategy: A string specifying the partitioning strategy. + Currently `"div"` and `"mod"` are supported. Default is `"div"`. + + + Returns: + Dense tensor of shape `[d_0, d_1, ..., d_{n-1}, e_1, ..., e_m]`. + + Raises: + ValueError: if `embedding_weights` is empty. - - - diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.contrib.framework.safe_embedding_lookup_sparse.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.contrib.framework.safe_embedding_lookup_sparse.md index f56043cc0d..3d5491c98a 100644 --- a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.contrib.framework.safe_embedding_lookup_sparse.md +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.contrib.framework.safe_embedding_lookup_sparse.md @@ -1,45 +1,44 @@ -### `tf.contrib.framework.safe_embedding_lookup_sparse(embedding_weights, sparse_ids, sparse_weights=None, combiner='mean', default_id=None, name=None, partition_strategy='div')` {#safe_embedding_lookup_sparse} - -Lookup embedding results, accounting for invalid IDs and empty features. - -The partitioned embedding in `embedding_weights` must all be the same shape -except for the first dimension. The first dimension is allowed to vary as the -vocabulary size is not necessarily a multiple of `P`. - -Invalid IDs (< 0) are pruned from input IDs and weights, as well as any IDs -with non-positive weight. For an entry with no features, the embedding vector -for `default_id` is returned, or the 0-vector if `default_id` is not supplied. - -The ids and weights may be multi-dimensional. Embeddings are always aggregated -along the last dimension. - -##### Args: - - -* <b>`embedding_weights`</b>: A list of `P` float tensors or values representing - partitioned embedding tensors. The total unpartitioned shape should be - `[e_0, e_1, ..., e_m]`, where `e_0` represents the vocab size and - `e_1, ..., e_m` are the embedding dimensions. -* <b>`sparse_ids`</b>: `SparseTensor` of shape `[d_0, d_1, ..., d_n]` containing the - ids. `d_0` is typically batch size. -* <b>`sparse_weights`</b>: `SparseTensor` of same shape as `sparse_ids`, containing - float weights corresponding to `sparse_ids`, or `None` if all weights - are be assumed to be 1.0. -* <b>`combiner`</b>: A string specifying how to combine embedding results for each - entry. Currently "mean", "sqrtn" and "sum" are supported, with "mean" - the default. -* <b>`default_id`</b>: The id to use for an entry with no features. -* <b>`name`</b>: A name for this operation (optional). -* <b>`partition_strategy`</b>: A string specifying the partitioning strategy. - Currently `"div"` and `"mod"` are supported. Default is `"div"`. - - -##### Returns: - - Dense tensor of shape `[d_0, d_1, ..., d_{n-1}, e_1, ..., e_m]`. - -##### Raises: - - -* <b>`ValueError`</b>: if `embedding_weights` is empty. +### `tf.contrib.framework.safe_embedding_lookup_sparse(*args, **kwargs)` {#safe_embedding_lookup_sparse} + +Lookup embedding results, accounting for invalid IDs and empty features. (deprecated) + +THIS FUNCTION IS DEPRECATED. It will be removed after 2016-09-01. +Instructions for updating: +Please use tf.contrib.layers.safe_embedding_lookup_sparse. + + The partitioned embedding in `embedding_weights` must all be the same shape + except for the first dimension. The first dimension is allowed to vary as the + vocabulary size is not necessarily a multiple of `P`. + + Invalid IDs (< 0) are pruned from input IDs and weights, as well as any IDs + with non-positive weight. For an entry with no features, the embedding vector + for `default_id` is returned, or the 0-vector if `default_id` is not supplied. + + The ids and weights may be multi-dimensional. Embeddings are always aggregated + along the last dimension. + + Args: + embedding_weights: A list of `P` float tensors or values representing + partitioned embedding tensors. The total unpartitioned shape should be + `[e_0, e_1, ..., e_m]`, where `e_0` represents the vocab size and + `e_1, ..., e_m` are the embedding dimensions. + sparse_ids: `SparseTensor` of shape `[d_0, d_1, ..., d_n]` containing the + ids. `d_0` is typically batch size. + sparse_weights: `SparseTensor` of same shape as `sparse_ids`, containing + float weights corresponding to `sparse_ids`, or `None` if all weights + are be assumed to be 1.0. + combiner: A string specifying how to combine embedding results for each + entry. Currently "mean", "sqrtn" and "sum" are supported, with "mean" + the default. + default_id: The id to use for an entry with no features. + name: A name for this operation (optional). + partition_strategy: A string specifying the partitioning strategy. + Currently `"div"` and `"mod"` are supported. Default is `"div"`. + + + Returns: + Dense tensor of shape `[d_0, d_1, ..., d_{n-1}, e_1, ..., e_m]`. + + Raises: + ValueError: if `embedding_weights` is empty. diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf.sparse_minimum.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf.sparse_minimum.md new file mode 100644 index 0000000000..4419f736b9 --- /dev/null +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf.sparse_minimum.md @@ -0,0 +1,28 @@ +### `tf.sparse_minimum(sp_a, sp_b, name=None)` {#sparse_minimum} + +Returns the element-wise min of two SparseTensors. + +Assumes the two SparseTensors have the same shape, i.e., no broadcasting. +Example: + +```python +sp_zero = ops.SparseTensor([[0]], [0], [7]) +sp_one = ops.SparseTensor([[1]], [1], [7]) +res = tf.sparse_minimum(sp_zero, sp_one).eval() +# "res" should be equal to SparseTensor([[0], [1]], [0, 0], [7]). +``` + +##### Args: + + +* <b>`sp_a`</b>: a `SparseTensor` operand whose dtype is real, and indices + lexicographically ordered. +* <b>`sp_b`</b>: the other `SparseTensor` operand with the same requirements (and the + same shape). +* <b>`name`</b>: optional name of the operation. + +##### Returns: + + +* <b>`output`</b>: the output SparseTensor. + diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard5/tf.sparse_maximum.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard5/tf.sparse_maximum.md new file mode 100644 index 0000000000..b934c3b1cd --- /dev/null +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard5/tf.sparse_maximum.md @@ -0,0 +1,28 @@ +### `tf.sparse_maximum(sp_a, sp_b, name=None)` {#sparse_maximum} + +Returns the element-wise max of two SparseTensors. + +Assumes the two SparseTensors have the same shape, i.e., no broadcasting. +Example: + +```python +sp_zero = ops.SparseTensor([[0]], [0], [7]) +sp_one = ops.SparseTensor([[1]], [1], [7]) +res = tf.sparse_maximum(sp_zero, sp_one).eval() +# "res" should be equal to SparseTensor([[0], [1]], [0, 1], [7]). +``` + +##### Args: + + +* <b>`sp_a`</b>: a `SparseTensor` operand whose dtype is real, and indices + lexicographically ordered. +* <b>`sp_b`</b>: the other `SparseTensor` operand with the same requirements (and the + same shape). +* <b>`name`</b>: optional name of the operation. + +##### Returns: + + +* <b>`output`</b>: the output SparseTensor. + diff --git a/tensorflow/g3doc/api_docs/python/index.md b/tensorflow/g3doc/api_docs/python/index.md index 5c4f7107d1..e9af0e6575 100644 --- a/tensorflow/g3doc/api_docs/python/index.md +++ b/tensorflow/g3doc/api_docs/python/index.md @@ -367,7 +367,9 @@ * [`sparse_add`](../../api_docs/python/sparse_ops.md#sparse_add) * [`sparse_concat`](../../api_docs/python/sparse_ops.md#sparse_concat) * [`sparse_fill_empty_rows`](../../api_docs/python/sparse_ops.md#sparse_fill_empty_rows) + * [`sparse_maximum`](../../api_docs/python/sparse_ops.md#sparse_maximum) * [`sparse_merge`](../../api_docs/python/sparse_ops.md#sparse_merge) + * [`sparse_minimum`](../../api_docs/python/sparse_ops.md#sparse_minimum) * [`sparse_reduce_sum`](../../api_docs/python/sparse_ops.md#sparse_reduce_sum) * [`sparse_reorder`](../../api_docs/python/sparse_ops.md#sparse_reorder) * [`sparse_reset_shape`](../../api_docs/python/sparse_ops.md#sparse_reset_shape) diff --git a/tensorflow/g3doc/api_docs/python/sparse_ops.md b/tensorflow/g3doc/api_docs/python/sparse_ops.md index 6781eadef4..1665420b5b 100644 --- a/tensorflow/g3doc/api_docs/python/sparse_ops.md +++ b/tensorflow/g3doc/api_docs/python/sparse_ops.md @@ -1155,3 +1155,65 @@ B dense [k, n] return A*B +- - - + +### `tf.sparse_maximum(sp_a, sp_b, name=None)` {#sparse_maximum} + +Returns the element-wise max of two SparseTensors. + +Assumes the two SparseTensors have the same shape, i.e., no broadcasting. +Example: + +```python +sp_zero = ops.SparseTensor([[0]], [0], [7]) +sp_one = ops.SparseTensor([[1]], [1], [7]) +res = tf.sparse_maximum(sp_zero, sp_one).eval() +# "res" should be equal to SparseTensor([[0], [1]], [0, 1], [7]). +``` + +##### Args: + + +* <b>`sp_a`</b>: a `SparseTensor` operand whose dtype is real, and indices + lexicographically ordered. +* <b>`sp_b`</b>: the other `SparseTensor` operand with the same requirements (and the + same shape). +* <b>`name`</b>: optional name of the operation. + +##### Returns: + + +* <b>`output`</b>: the output SparseTensor. + + +- - - + +### `tf.sparse_minimum(sp_a, sp_b, name=None)` {#sparse_minimum} + +Returns the element-wise min of two SparseTensors. + +Assumes the two SparseTensors have the same shape, i.e., no broadcasting. +Example: + +```python +sp_zero = ops.SparseTensor([[0]], [0], [7]) +sp_one = ops.SparseTensor([[1]], [1], [7]) +res = tf.sparse_minimum(sp_zero, sp_one).eval() +# "res" should be equal to SparseTensor([[0], [1]], [0, 0], [7]). +``` + +##### Args: + + +* <b>`sp_a`</b>: a `SparseTensor` operand whose dtype is real, and indices + lexicographically ordered. +* <b>`sp_b`</b>: the other `SparseTensor` operand with the same requirements (and the + same shape). +* <b>`name`</b>: optional name of the operation. + +##### Returns: + + +* <b>`output`</b>: the output SparseTensor. + + |