Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
dòng chảy căng:: ôi:: Bình đẳng
#include <math_ops.h>
Trả về giá trị thực của (x == y) theo phần tử.
Bản tóm tắt
LƯU Ý : Equal
hỗ trợ phát sóng. Tìm hiểu thêm về phát sóng tại đây
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])
Lập luận:
Trả về:
Thuộc tính công khai
Chức năng công cộng
nút
::tensorflow::Node * node() const
operator::tensorflow::Input() const
toán tử::tenorflow::Đầu ra
operator::tensorflow::Output() const
Các hàm tĩnh công khai
Hình dạng không tương thíchLỗi
Attrs IncompatibleShapeError(
bool x
)
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 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.1/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\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/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.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x, ::`[tensorflow::Input](/versions/r2.1/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.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` y, const `[Equal::Attrs](/versions/r2.1/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.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [z](#classtensorflow_1_1ops_1_1_equal_1af7bbce811e57c82c34bd390f377fbbf5) | `::`[tensorflow::Output](/versions/r2.1/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.1/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.1/api_docs/cc/struct/tensorflow/ops/equal/attrs) | Optional attribute setters for [Equal](/versions/r2.1/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```"]]