# tf.raw_ops.UpperBound

<br />

Applies upper_bound(sorted_search_values, values) along each row.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.raw_ops.UpperBound`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/UpperBound)

<br />

    tf.raw_ops.UpperBound(
        sorted_inputs,
        values,
        out_type=https://www.tensorflow.org/versions/r2.14/api_docs/python/tf/dtypes#int32,
        name=None
    )

Each set of rows with the same index in (sorted_inputs, values) is treated
independently. The resulting row is the equivalent of calling
`np.searchsorted(sorted_inputs, values, side='right')`.

The result is not a global index to the entire
`Tensor`, but rather just the index in the last dimension.

A 2-D example:
sorted_sequence = \[\[0, 3, 9, 9, 10\],
\[1, 2, 3, 4, 5\]\]
values = \[\[2, 4, 9\],
\[0, 2, 6\]\]

result = UpperBound(sorted_sequence, values)

result == \[\[1, 2, 4\],
\[0, 2, 5\]\]

<br />

<br />

<br />

| ## Args ||
|---|---|
| `sorted_inputs` | A `Tensor`. 2-D Tensor where each row is ordered. |
| `values` | A `Tensor`. Must have the same type as `sorted_inputs`. 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains the values that will be searched for in `sorted_search_values`. |
| `out_type` | An optional [`tf.DType`](https://www.tensorflow.org/versions/r2.14/api_docs/python/tf/dtypes/DType) from: `tf.int32, tf.int64`. Defaults to [`tf.int32`](https://www.tensorflow.org/versions/r2.14/api_docs/python/tf#int32). |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of type `out_type`. ||

<br />