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:: Trống
#include <array_ops.h>
Tạo một tensor có hình dạng nhất định.
Bản tóm tắt
Thao tác này tạo ra một tensor có shape
và dtype
.
Lập luận:
- phạm vi: Một đối tượng Phạm vi
- hình dạng: 1-D. Biểu thị hình dạng của tensor đầu ra.
Thuộc tính tùy chọn (xem Attrs
):
- init: Nếu đúng, hãy khởi tạo tensor trả về với giá trị mặc định là dtype. Mặt khác, việc triển khai miễn phí không khởi tạo nội dung của tensor.
Trả về:
Các hàm tĩnh công khai |
---|
Init (bool x) | |
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
Ban đầu
Attrs Init(
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-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# tensorflow::ops::Empty Class Reference\n\ntensorflow::ops::Empty\n======================\n\n`#include \u003carray_ops.h\u003e`\n\nCreates a tensor with the given shape.\n\nSummary\n-------\n\nThis operation creates a tensor of `shape` and `dtype`.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- shape: 1-D. Represents the shape of the output tensor.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.0/api_docs/cc/struct/tensorflow/ops/empty/attrs#structtensorflow_1_1ops_1_1_empty_1_1_attrs)):\n\n- init: If True, initialize the returned tensor with the default value of dtype. Otherwise, the implementation is free not to initializethe tensor's content.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A [Tensor](/versions/r2.0/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of type `T`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Empty](#classtensorflow_1_1ops_1_1_empty_1afbeeb90876baaa5131ccd9ae1a733689)`(const ::`[tensorflow::Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` shape, DataType dtype)` ||\n| [Empty](#classtensorflow_1_1ops_1_1_empty_1a17ea31d51cede367a541675480d77a3f)`(const ::`[tensorflow::Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` shape, DataType dtype, const `[Empty::Attrs](/versions/r2.0/api_docs/cc/struct/tensorflow/ops/empty/attrs#structtensorflow_1_1ops_1_1_empty_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_empty_1ae377e8630513546e65d719d56ecfe136) | [Operation](/versions/r2.0/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_empty_1a9c7d05401a0aa67f82fe592682f0bc15) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_empty_1a4fdbda6ce5b2f476acc70ada9df3eaa2)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_empty_1ac54e9b4ae90bf596166c770dc6d22ce5)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_empty_1a9ae3f6fbe95cde1fcec65896b5397511)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|\n| [Init](#classtensorflow_1_1ops_1_1_empty_1ac0b3b4819671ba0dd14c7ca6c1bacae4)`(bool x)` | [Attrs](/versions/r2.0/api_docs/cc/struct/tensorflow/ops/empty/attrs#structtensorflow_1_1ops_1_1_empty_1_1_attrs) |\n\n| ### Structs ||\n|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::Empty::Attrs](/versions/r2.0/api_docs/cc/struct/tensorflow/ops/empty/attrs) | Optional attribute setters for [Empty](/versions/r2.0/api_docs/cc/class/tensorflow/ops/empty#classtensorflow_1_1ops_1_1_empty). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### Empty\n\n```gdscript\n Empty(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input shape,\n DataType dtype\n)\n``` \n\n### Empty\n\n```gdscript\n Empty(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input shape,\n DataType dtype,\n const Empty::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### Init\n\n```text\nAttrs Init(\n bool x\n)\n```"]]