Python - tensorflow.math.lbeta()
Last Updated :
14 Sep, 2021
TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks.
lbeta() is used to compute ln(|Beta(x)|). It reduces the tensor along the last dimension. If one-dimensional z is [z1, ..., zk], then Beta(z) is defined as
If x is n+1 dimensional tensor with shape [N1 , . . ., Nn , k], last dimension is treated as z vector and,
If z = [u, v] then traditional bivariate beta function is defined as

Syntax: tensorflow.math.lbeta( x, name)
Parameters:
- x: It's the input tensor with rank n+1 where n>=0. Allowed dtypes are float, or double.
- name(optional): It defines the name for the operation.
Returns:
It returns the logarithm of |Beta(x)| reducing along the last dimension.
Example 1:
Python3
# Importing the library
import tensorflow as tf
# Initializing the input tensor
a = tf.constant([[7, 8], [13, 11]], dtype = tf.float64)
# Printing the input tensor
print('a: ', a)
# Calculating the result
res = tf.math.lbeta(x = a)
# Printing the result
print('Result: ', res)
Output:
a: tf.Tensor(
[[ 7. 8.]
[13. 11.]], shape=(2, 2), dtype=float64)
Result: tf.Tensor([-10.08680861 -16.5150485 ], shape=(2, ), dtype=float64)
Example 2:
Python3
# Importing the library
import tensorflow as tf
# Initializing the input tensor
a = tf.constant([7, 8, 13, 11], dtype = tf.float64)
# Printing the input tensor
print('a: ', a)
# Calculating the result
res = tf.math.lbeta(x = a)
# Printing the result
print('Result: ', res)
Output:
a: tf.Tensor([ 7. 8. 13. 11.], shape=(4, ), dtype=float64)
Result: tf.Tensor(-52.77215897270088, shape=(), dtype=float64)
Similar Reads
Python - tensorflow.math.less() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. less() is used to find element wise truth value of x<y. It supports broadcasting Syntax: tensorflow.math.less( x, y, name) Parameters: x: It is a tensor. Allowed dty
2 min read
Python - tensorflow.math.atan() TensorFlow is open-source python library designed by Google to develop Machine Learning models and deep learning  neural networks. atan() is used to find element wise atan of x. Syntax: tf.math.atan(x, name) Parameters: x: It's the input tensor. Allowed dtype for this tensor are bfloat16, half, flo
1 min read
Python - tensorflow.math.atanh() TensorFlow is open-source python library designed by Google to develop Machine Learning models and deep learning  neural networks. atanh() is used to find element wise atanh of x. Syntax: tf.math.atanh(x, name) Parameters: x: It's the input tensor. Allowed dtype for this tensor are bfloat16, half,
1 min read
Python - tensorflow.math.equal() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. equal() is used to perform element by equality comparison.  It performs argument broadcasting before applying the comparison. Syntax: tensorflow.math.equal( x, y, name)
2 min read
Python - tensorflow.math.lgamma() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. lgamma() is used to Compute element wise log of absolute value of Gamma(x). Syntax: tensorflow.math.lgamma( x, name) Parameters: x: It is a tensor. Allowed dtypes are b
1 min read