# tensorflow::ops::SparseCrossHashed Class Reference

# tensorflow::ops::SparseCrossHashed

`#include <sparse_ops.h>`

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

## Summary

The op takes two lists, one of 2D `SparseTensor` and one of 2D `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor`, each representing features of one feature column. It outputs a 2D `SparseTensor` with the batchwise crosses of these features.

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"]]
```

<br />

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"
```

<br />

if hashed_output=true then the output will be

```
shape = [2, 2]
[0, 0]: FingerprintCat64(
            Fingerprint64("f"), FingerprintCat64(
                Fingerprint64("d"), Fingerprint64("a")))
[1, 0]: FingerprintCat64(
            Fingerprint64("g"), FingerprintCat64(
                Fingerprint64("e"), Fingerprint64("b")))
[1, 1]: FingerprintCat64(
            Fingerprint64("g"), FingerprintCat64(
                Fingerprint64("e"), Fingerprint64("c")))
```

<br />

Arguments:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- indices: 2-D. Indices of each input `SparseTensor`.
- values: 1-D. values of each `SparseTensor`.
- shapes: 1-D. Shapes of each `SparseTensor`.
- dense_inputs: 2-D. Columns represented by dense `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor`.
- num_buckets: It is used if hashed_output is true. output = hashed_valuenum_buckets if num_buckets \> 0 else hashed_value.
- strong_hash: boolean, if true, siphash with salt will be used instead of farmhash.
- salt: Specify the salt that will be used by the siphash function.

<br />

Returns:

- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` output_indices: 2-D. Indices of the concatenated `SparseTensor`.
- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` output_values: 1-D. Non-empty values of the concatenated or hashed `SparseTensor`.
- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` output_shape: 1-D. Shape of the concatenated `SparseTensor`.

<br />

| ### Constructors and Destructors ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/sparse-cross-hashed#classtensorflow_1_1ops_1_1_sparse_cross_hashed_1a75df417d574408f2c120294be39de389(const ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list indices, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list values, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list shapes, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list dense_inputs, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input num_buckets, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input strong_hash, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input salt)` ||

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/sparse-cross-hashed#classtensorflow_1_1ops_1_1_sparse_cross_hashed_1a68e99ac704684420839783001f5f37f4` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/sparse-cross-hashed#classtensorflow_1_1ops_1_1_sparse_cross_hashed_1a13ce1f14f64b18d1c495ccf725acf0bb` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/sparse-cross-hashed#classtensorflow_1_1ops_1_1_sparse_cross_hashed_1a89578d009bb75ad63a153f89045c46a2` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/sparse-cross-hashed#classtensorflow_1_1ops_1_1_sparse_cross_hashed_1a6371e5ae28289305864042629e0b4fe5` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |

## Public attributes

### operation

```
Operation operation
```

### output_indices

```
::tensorflow::Output output_indices
```

### output_shape

```
::tensorflow::Output output_shape
```

### output_values

```
::tensorflow::Output output_values
```

## Public functions

### SparseCrossHashed

```
 SparseCrossHashed(
  const ::tensorflow::Scope & scope,
  ::tensorflow::InputList indices,
  ::tensorflow::InputList values,
  ::tensorflow::InputList shapes,
  ::tensorflow::InputList dense_inputs,
  ::tensorflow::Input num_buckets,
  ::tensorflow::Input strong_hash,
  ::tensorflow::Input salt
)
```