tf.math.is_strictly_increasing
Возвращает True, если x строго возрастает.
tf.math.is_strictly_increasing(
x, name=None
)
Элементы x сравниваются в порядке следования строк. Tensor [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 не является числовым тензором. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/math/is_strictly_increasing