W3cubDocs

/TensorFlow 1.15

tf.sparse.cross

View source on GitHub

Generates sparse cross from a list of sparse and dense tensors.

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.

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/sparse/cross