tf.raw_ops.UpperBound
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Applies upper_bound(sorted_search_values, values) along each row.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
tf.compat.v1.raw_ops.UpperBound
tf.raw_ops.UpperBound(
sorted_inputs,
values,
out_type=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]]
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 from: tf.int32, tf.int64 . Defaults to tf.int32 .
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor of type out_type .
|
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. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.UpperBound\n\n\u003cbr /\u003e\n\nApplies upper_bound(sorted_search_values, values) along each row.\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.raw_ops.UpperBound`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/UpperBound)\n\n\u003cbr /\u003e\n\n tf.raw_ops.UpperBound(\n sorted_inputs,\n values,\n out_type=../../tf/dtypes#int32,\n name=None\n )\n\nEach set of rows with the same index in (sorted_inputs, values) is treated\nindependently. The resulting row is the equivalent of calling\n`np.searchsorted(sorted_inputs, values, side='right')`.\n\nThe result is not a global index to the entire\n`Tensor`, but rather just the index in the last dimension.\n\nA 2-D example:\nsorted_sequence = \\[\\[0, 3, 9, 9, 10\\],\n\\[1, 2, 3, 4, 5\\]\\]\nvalues = \\[\\[2, 4, 9\\],\n\\[0, 2, 6\\]\\]\n\nresult = UpperBound(sorted_sequence, values)\n\nresult == \\[\\[1, 2, 4\\],\n\\[0, 2, 5\\]\\]\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sorted_inputs` | A `Tensor`. 2-D Tensor where each row is ordered. |\n| `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`. |\n| `out_type` | An optional [`tf.DType`](../../tf/dtypes/DType) from: `tf.int32, tf.int64`. Defaults to [`tf.int32`](../../tf#int32). |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Tensor` of type `out_type`. ||\n\n\u003cbr /\u003e"]]