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
|
description: <<END
|
||||||
*NOTE*: `Greater` supports broadcasting. More about broadcasting
|
*NOTE*: `Greater` supports broadcasting. More about broadcasting
|
||||||
[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
|
[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
|
END
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,17 @@ op {
|
|||||||
description: <<END
|
description: <<END
|
||||||
*NOTE*: `GreaterEqual` supports broadcasting. More about broadcasting
|
*NOTE*: `GreaterEqual` supports broadcasting. More about broadcasting
|
||||||
[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
|
[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
|
END
|
||||||
}
|
}
|
||||||
|
@ -5,5 +5,12 @@ op {
|
|||||||
@compatibility(numpy)
|
@compatibility(numpy)
|
||||||
Equivalent to np.isfinite
|
Equivalent to np.isfinite
|
||||||
@end_compatibility
|
@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
|
END
|
||||||
}
|
}
|
||||||
|
@ -5,5 +5,12 @@ op {
|
|||||||
@compatibility(numpy)
|
@compatibility(numpy)
|
||||||
Equivalent to np.isinf
|
Equivalent to np.isinf
|
||||||
@end_compatibility
|
@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
|
END
|
||||||
}
|
}
|
||||||
|
@ -5,5 +5,12 @@ op {
|
|||||||
@compatibility(numpy)
|
@compatibility(numpy)
|
||||||
Equivalent to np.isnan
|
Equivalent to np.isnan
|
||||||
@end_compatibility
|
@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
|
END
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,17 @@ op {
|
|||||||
description: <<END
|
description: <<END
|
||||||
*NOTE*: `Less` supports broadcasting. More about broadcasting
|
*NOTE*: `Less` supports broadcasting. More about broadcasting
|
||||||
[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
|
[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
|
END
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,17 @@ op {
|
|||||||
description: <<END
|
description: <<END
|
||||||
*NOTE*: `LessEqual` supports broadcasting. More about broadcasting
|
*NOTE*: `LessEqual` supports broadcasting. More about broadcasting
|
||||||
[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
|
[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
|
END
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,15 @@
|
|||||||
op {
|
op {
|
||||||
graph_op_name: "Lgamma"
|
graph_op_name: "Lgamma"
|
||||||
summary: "Computes the log of the absolute value of `Gamma(x)` element-wise."
|
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."
|
summary: "Computes natural logarithm of x element-wise."
|
||||||
description: <<END
|
description: <<END
|
||||||
I.e., \\(y = \log_e x\\).
|
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
|
END
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,12 @@ op {
|
|||||||
summary: "Computes natural logarithm of (1 + x) element-wise."
|
summary: "Computes natural logarithm of (1 + x) element-wise."
|
||||||
description: <<END
|
description: <<END
|
||||||
I.e., \\(y = \log_e (1 + x)\\).
|
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
|
END
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user