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:: những người thích
#include <array_ops.h>
Trả về một tensor đơn vị có cùng hình dạng và kiểu như x.
Bản tóm tắt
Lập luận:
- phạm vi: Một đối tượng phạm vi
- x: một tensor loại T.
Trả về:
-
Output
: một tensor có cùng hình dạng và kiểu như x nhưng chứa đầy những cái đơn 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
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-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# tensorflow::ops::OnesLike Class Reference\n\ntensorflow::ops::OnesLike\n=========================\n\n`#include \u003carray_ops.h\u003e`\n\nReturns a tensor of ones with the same shape and type as x.\n\nSummary\n-------\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- x: a tensor of type T.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): a tensor of the same shape and type as x but filled with ones.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [OnesLike](#classtensorflow_1_1ops_1_1_ones_like_1a9ce5ff05ed7a04ebf915963d1d8435f7)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x)` ||\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_ones_like_1ac15e18a4a512477f8e10e519abfcd6b7) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [y](#classtensorflow_1_1ops_1_1_ones_like_1ac6af054ea600a2d677e11ec5900b7ee4) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_ones_like_1a53d2c8964e88803f776b16e1df73c514)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ones_like_1a775247133ef103fc360424785831c02b)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ones_like_1a321015b1e5fdb2859fc8126f97dc2b12)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### y\n\n```text\n::tensorflow::Output y\n``` \n\nPublic functions\n----------------\n\n### OnesLike\n\n```gdscript\n OnesLike(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input x\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```"]]