tensorflow tf.equal(x, y, name=None)

来源:互联网 发布:linux常用的命令有哪些 编辑:程序博客网 时间:2024/06/07 16:26

tf.equal(x, y, name=None)

Returns the truth value of (x == y) element-wise.

Args:
  • x: A Tensor. Must be one of the following types: float32float64int32int64complex64quint8qint8,qint32.
  • y: A Tensor. Must have the same type as x.
  • name: A name for the operation (optional).
Returns:

Tensor of type bool.


代码举例:

a = tf.constant([2,3])b = tf.constant([3,4])sess.run(tf.equal(a,b))

输出:

array([False, False], dtype=bool)

阅读全文
0 0
原创粉丝点击