Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::Equal
#include <math_ops.h>
Returns the truth value of (x == y) element-wise.
Summary
NOTE: Equal
supports broadcasting. More about broadcasting here
x = tf.constant([2, 4])
y = tf.constant(2)
tf.math.equal(x, y) ==> array([True, False])
x = tf.constant([2, 4])
y = tf.constant([2, 4])
tf.math.equal(x, y) ==> array([True, True])
Args:
Returns:
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
IncompatibleShapeError
Attrs IncompatibleShapeError(
bool x
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::Equal Class Reference\n\ntensorflow::ops::Equal\n======================\n\n`#include \u003cmath_ops.h\u003e`\n\nReturns the truth value of (x == y) element-wise.\n\nSummary\n-------\n\n*NOTE* : [Equal](/versions/r2.14/api_docs/cc/class/tensorflow/ops/equal#classtensorflow_1_1ops_1_1_equal) supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)\n\n\n```gdscript\nx = tf.constant([2, 4])\ny = tf.constant(2)\ntf.math.equal(x, y) ==\u003e array([True, False])\n```\n\n\u003cbr /\u003e\n\n\n```gdscript\nx = tf.constant([2, 4])\ny = tf.constant([2, 4])\ntf.math.equal(x, y) ==\u003e array([True, True])\n```\n\n\u003cbr /\u003e\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The z tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Equal](#classtensorflow_1_1ops_1_1_equal_1a71df1d727899d9748a710214e9643ae4)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` y)` ||\n| [Equal](#classtensorflow_1_1ops_1_1_equal_1a6de2f17f741ab89eee7bb268fa5a00cb)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` y, const `[Equal::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/equal/attrs#structtensorflow_1_1ops_1_1_equal_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_equal_1a47c6893382f9747ebc851ee095e680df) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [z](#classtensorflow_1_1ops_1_1_equal_1af7bbce811e57c82c34bd390f377fbbf5) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_equal_1a815a2eaa20ab636416bdc6c81c504d01)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_equal_1a54b4b003cfdb637811b2b384ae9333eb)`() const ` | |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_equal_1a92922d4aec5aedb26c6abfcff968a304)`() const ` | |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|\n| [IncompatibleShapeError](#classtensorflow_1_1ops_1_1_equal_1aff7de7b3ec11004e350cfa8bedfcde9d)`(bool x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/equal/attrs#structtensorflow_1_1ops_1_1_equal_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::Equal::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/equal/attrs) | Optional attribute setters for [Equal](/versions/r2.14/api_docs/cc/class/tensorflow/ops/equal#classtensorflow_1_1ops_1_1_equal). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### z\n\n```text\n::tensorflow::Output z\n``` \n\nPublic functions\n----------------\n\n### Equal\n\n```gdscript\n Equal(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input x,\n ::tensorflow::Input y\n)\n``` \n\n### Equal\n\n```gdscript\n Equal(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input x,\n ::tensorflow::Input y,\n const Equal::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### IncompatibleShapeError\n\n```text\nAttrs IncompatibleShapeError(\n bool x\n)\n```"]]