tf.math.logical_and

Returns the truth value of x AND y element-wise.

Used in the notebooks

Used in the tutorials

Logical AND function.

Requires that x and y have the same shape or have broadcast-compatible shapes. For example, x and y can be:

  • Two single elements of type bool.
  • One tf.Tensor of type bool and one single bool, where the result will be calculated by applying logical AND with the single element to each element in the larger Tensor.
  • Two tf.Tensor objects of type bool of the same shape. In this case, the result will be the element-wise logical AND of the two input tensors.

You can also use the & operator instead.

Usage:

a = tf.constant([True])
b = tf.constant([False])