Merge pull request #30157 from SSaishruthi:tf_2.0_math_1
PiperOrigin-RevId: 270608409
This commit is contained in:
commit
c33b99e859
@ -4,5 +4,17 @@ op {
|
||||
description: <<END
|
||||
*NOTE*: `Greater` supports broadcasting. More about broadcasting
|
||||
[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
x = tf.constant([5, 4, 6])
|
||||
y = tf.constant([5, 2, 5])
|
||||
tf.math.greater(x, y) ==> [False, True, True]
|
||||
|
||||
x = tf.constant([5, 4, 6])
|
||||
y = tf.constant([5])
|
||||
tf.math.greater(x, y) ==> [False, False, True]
|
||||
```
|
||||
END
|
||||
}
|
||||
|
@ -4,5 +4,17 @@ op {
|
||||
description: <<END
|
||||
*NOTE*: `GreaterEqual` supports broadcasting. More about broadcasting
|
||||
[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
x = tf.constant([5, 4, 6, 7])
|
||||
y = tf.constant([5, 2, 5, 10])
|
||||
tf.math.greater_equal(x, y) ==> [True, True, True, False]
|
||||
|
||||
x = tf.constant([5, 4, 6, 7])
|
||||
y = tf.constant([5])
|
||||
tf.math.greater_equal(x, y) ==> [True, False, True, True]
|
||||
```
|
||||
END
|
||||
}
|
||||
|
@ -5,5 +5,12 @@ op {
|
||||
@compatibility(numpy)
|
||||
Equivalent to np.isfinite
|
||||
@end_compatibility
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
x = tf.constant([5.0, 4.8, 6.8, np.inf, np.nan])
|
||||
tf.math.is_finite(x) ==> [True, True, True, False, False]
|
||||
```
|
||||
END
|
||||
}
|
||||
|
@ -5,5 +5,12 @@ op {
|
||||
@compatibility(numpy)
|
||||
Equivalent to np.isinf
|
||||
@end_compatibility
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
x = tf.constant([5.0, np.inf, 6.8, np.inf])
|
||||
tf.math.is_inf(x) ==> [False, True, False, True]
|
||||
```
|
||||
END
|
||||
}
|
||||
|
@ -5,5 +5,12 @@ op {
|
||||
@compatibility(numpy)
|
||||
Equivalent to np.isnan
|
||||
@end_compatibility
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
x = tf.constant([5.0, np.nan, 6.8, np.nan, np.inf])
|
||||
tf.math.is_nan(x) ==> [False, True, False, True, False]
|
||||
```
|
||||
END
|
||||
}
|
||||
|
@ -4,5 +4,17 @@ op {
|
||||
description: <<END
|
||||
*NOTE*: `Less` supports broadcasting. More about broadcasting
|
||||
[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
x = tf.constant([5, 4, 6])
|
||||
y = tf.constant([5])
|
||||
tf.math.less(x, y) ==> [False, True, False]
|
||||
|
||||
x = tf.constant([5, 4, 6])
|
||||
y = tf.constant([5, 6, 7])
|
||||
tf.math.less(x, y) ==> [False, True, True]
|
||||
```
|
||||
END
|
||||
}
|
||||
|
@ -4,5 +4,17 @@ op {
|
||||
description: <<END
|
||||
*NOTE*: `LessEqual` supports broadcasting. More about broadcasting
|
||||
[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
x = tf.constant([5, 4, 6])
|
||||
y = tf.constant([5])
|
||||
tf.math.less_equal(x, y) ==> [True, True, False]
|
||||
|
||||
x = tf.constant([5, 4, 6])
|
||||
y = tf.constant([5, 6, 6])
|
||||
tf.math.less_equal(x, y) ==> [True, True, True]
|
||||
```
|
||||
END
|
||||
}
|
||||
|
@ -1,4 +1,15 @@
|
||||
op {
|
||||
graph_op_name: "Lgamma"
|
||||
summary: "Computes the log of the absolute value of `Gamma(x)` element-wise."
|
||||
description: <<END
|
||||
For positive numbers, this function computes log((input - 1)!) for every element in the tensor.
|
||||
`lgamma(5) = log((5-1)!) = log(4!) = log(24) = 3.1780539`
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
x = tf.constant([0, 0.5, 1, 4.5, -4, -5.6])
|
||||
tf.math.lgamma(x) ==> [inf, 0.5723649, 0., 2.4537368, inf, -4.6477685]
|
||||
```
|
||||
END
|
||||
}
|
||||
|
@ -3,5 +3,12 @@ op {
|
||||
summary: "Computes natural logarithm of x element-wise."
|
||||
description: <<END
|
||||
I.e., \\(y = \log_e x\\).
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
x = tf.constant([0, 0.5, 1, 5])
|
||||
tf.math.log(x) ==> [-inf, -0.6931472, 0. , 1.609438]
|
||||
```
|
||||
END
|
||||
}
|
||||
|
@ -3,5 +3,12 @@ op {
|
||||
summary: "Computes natural logarithm of (1 + x) element-wise."
|
||||
description: <<END
|
||||
I.e., \\(y = \log_e (1 + x)\\).
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
x = tf.constant([0, 0.5, 1, 5])
|
||||
tf.math.log1p(x) ==> [0., 0.4054651, 0.6931472, 1.7917595]
|
||||
```
|
||||
END
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user