tf.sparse.cross
Stay organized with collections
Save and categorize content based on your preferences.
Generates sparse cross from a list of sparse and dense tensors.
tf.sparse.cross(
inputs, name=None
)
For example, if the inputs are
* inputs[0]: SparseTensor with shape = [2, 2]
[0, 0]: "a"
[1, 0]: "b"
[1, 1]: "c"
* inputs[1]: SparseTensor with shape = [2, 1]
[0, 0]: "d"
[1, 0]: "e"
* inputs[2]: Tensor [["f"], ["g"]]
then the output will be:
shape = [2, 2]
[0, 0]: "a_X_d_X_f"
[1, 0]: "b_X_e_X_g"
[1, 1]: "c_X_e_X_g"
Args |
inputs
|
An iterable of Tensor or SparseTensor .
|
name
|
Optional name for the op.
|
Returns |
A SparseTensor of type string .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.sparse.cross\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/sparse/cross) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/sparse_ops.py#L519-L548) |\n\nGenerates sparse cross from a list of sparse and dense tensors.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.sparse.cross`](/api_docs/python/tf/sparse/cross), \\`tf.compat.v2.sparse.cross\\`\n\n\u003cbr /\u003e\n\n tf.sparse.cross(\n inputs, name=None\n )\n\nFor example, if the inputs are \n\n * inputs[0]: SparseTensor with shape = [2, 2]\n [0, 0]: \"a\"\n [1, 0]: \"b\"\n [1, 1]: \"c\"\n * inputs[1]: SparseTensor with shape = [2, 1]\n [0, 0]: \"d\"\n [1, 0]: \"e\"\n * inputs[2]: Tensor [[\"f\"], [\"g\"]]\n\nthen the output will be: \n\n shape = [2, 2]\n [0, 0]: \"a_X_d_X_f\"\n [1, 0]: \"b_X_e_X_g\"\n [1, 1]: \"c_X_e_X_g\"\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------|--------------------------------------------|\n| `inputs` | An iterable of `Tensor` or `SparseTensor`. |\n| `name` | Optional name for the op. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `SparseTensor` of type `string`. ||\n\n\u003cbr /\u003e"]]