tf.math.is_strictly_increasing
| Просмотреть исходный код на GitHub |
Возвращает True если x строго возрастает.
tf.math.is_strictly_increasing(
x, name=None
)
Элементы x сравниваются в порядке следования строк. Тензор [x[0],...] строго возрастает, если для каждой пары соседних элементов выполняется условие x[i] < x[i+1]. Если x имеет менее двух элементов, то он тривиально строго возрастает.
См. также: is_non_decreasing
x1 = tf.constant([1.0, 2.0, 3.0]) tf.math.is_strictly_increasing(x1) <tf.Tensor: shape=(), dtype=bool, numpy=True> x2 = tf.constant([3.0, 1.0, 2.0]) tf.math.is_strictly_increasing(x2) <tf.Tensor: shape=(), dtype=bool, numpy=False>
| Аргументы | |
|---|---|
x | Числовой Tensor. |
name | Имя для этой операции (необязательно). По умолчанию "is_strictly_increasing" |
| Возвращаемое значение | |
|---|---|
Булевый Tensor, равный True тогда и только тогда, когда x строго возрастает. |
| Исключения | |
|---|---|
TypeError | если x не является числовым тензором. |
© 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/r2.4/api_docs/python/tf/math/is_strictly_increasing