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:: Phân tích cú phápVí dụ
#include <parsing_ops.h>
Chuyển đổi một vectơ của não. Ví dụ các proto (dưới dạng chuỗi) thành các tensor được gõ.
Bản tóm tắt
Lập luận:
- phạm vi: Một đối tượng phạm vi
- được tuần tự hóa: Một vectơ chứa một loạt các nguyên mẫu Ví dụ được tuần tự hóa nhị phân.
- tên: Một vectơ chứa tên của các proto được tuần tự hóa. Có thể chứa, ví dụ, tên khóa bảng (mô tả) cho các proto được xê-ri hóa tương ứng. Đây hoàn toàn hữu ích cho mục đích gỡ lỗi và sự hiện diện của các giá trị ở đây không ảnh hưởng đến đầu ra. Cũng có thể là một vectơ trống nếu không có tên. Nếu không trống, vectơ này phải có cùng độ dài với "được tuần tự hóa".
- thưa_keys: Danh sách các Tensors chuỗi Nsparse (vô hướng). Các khóa dự kiến trong các tính năng của Ví dụ được liên kết với các giá trị thưa thớt.
- dense_keys: Danh sách Tensors chuỗi Ndense (vô hướng). Các khóa dự kiến trong các tính năng của Ví dụ được liên kết với các giá trị dày đặc.
- dense_defaults: Danh sách các Tensor Ndense (một số có thể trống). dense_defaults[j] cung cấp các giá trị mặc định khi feature_map của ví dụ thiếudense_key[j]. Nếu một Tensor trống được cung cấp chodense_defaults[j] thì tính năngdense_keys[j] là bắt buộc. Loại đầu vào được suy ra từdense_defaults[j], ngay cả khi nó trống. Nếudense_defaults[j] không trống vàdense_shapes[j] được xác định đầy đủ thì hình dạng củadense_defaults[j] phải khớp với hình dạng củadense_shapes[j]. Nếudense_shapes[j] có thứ nguyên chính không xác định (tính năng dày đặc sải bước thay đổi),dense_defaults[j] phải chứa một phần tử duy nhất: phần tử đệm.
- thưa_types: Danh sách các loại Nsparse; các kiểu dữ liệu của dữ liệu trong mỗi Tính năng được cung cấp trong spzzy_keys. Hiện tại ParseExample hỗ trợ DT_FLOAT (FloatList), DT_INT64 (Int64List) và DT_STRING (BytesList).
- dense_shapes: Danh sách các hình dạng Ndense; hình dạng của dữ liệu trong mỗi Tính năng được đưa ra trongdense_keys. Số phần tử trong Đối tượng tương ứng vớidense_key[j] phải luôn bằngdense_shapes[j].NumEntries(). Nếudense_shapes[j] == (D0, D1, ..., DN) thì hình dạng của đầu ra Tensordense_values [j] sẽ là (|serialized|, D0, D1, ..., DN): Các đầu ra dày đặc là chỉ các hàng đầu vào được xếp chồng lên nhau theo đợt. Điều này hoạt động vớidense_shapes[j] = (-1, D1, ..., DN). Trong trường hợp này, hình dạng của đầu ra Tensordense_values [j] sẽ là (|serialized|, M, D1, .., DN), trong đó M là số khối phần tử tối đa có độ dài D1 * .... * DN , trên tất cả các mục nhập minibatch trong đầu vào. Bất kỳ mục nhập minibatch nào có ít hơn M khối phần tử có độ dài D1 * ... * DN sẽ được đệm bằng phần tử vô hướng default_value tương ứng dọc theo chiều thứ hai.
Trả về:
-
OutputList
thớt_indices -
OutputList
thớt_values -
OutputList
thớt_shapes -
OutputList
đặc_values
Thuộc tính công khai
Chức năng công cộng
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-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# tensorflow::ops::ParseExample Class Reference\n\ntensorflow::ops::ParseExample\n=============================\n\n`#include \u003cparsing_ops.h\u003e`\n\nTransforms a vector of brain.Example protos (as strings) into typed tensors.\n\nSummary\n-------\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- serialized: A vector containing a batch of binary serialized Example protos.\n- names: A vector containing the names of the serialized protos. May contain, for example, table key (descriptive) names for the corresponding serialized protos. These are purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty vector if no names are available. If non-empty, this vector must be the same length as \"serialized\".\n- sparse_keys: A list of Nsparse string Tensors (scalars). The keys expected in the Examples' features associated with sparse values.\n- dense_keys: A list of Ndense string Tensors (scalars). The keys expected in the Examples' features associated with dense values.\n- dense_defaults: A list of Ndense Tensors (some may be empty). dense_defaults\\[j\\] provides default values when the example's feature_map lacks dense_key\\[j\\]. If an empty [Tensor](/versions/r2.2/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) is provided for dense_defaults\\[j\\], then the Feature dense_keys\\[j\\] is required. The input type is inferred from dense_defaults\\[j\\], even when it's empty. If dense_defaults\\[j\\] is not empty, and dense_shapes\\[j\\] is fully defined, then the shape of dense_defaults\\[j\\] must match that of dense_shapes\\[j\\]. If dense_shapes\\[j\\] has an undefined major dimension (variable strides dense feature), dense_defaults\\[j\\] must contain a single element: the padding element.\n- sparse_types: A list of Nsparse types; the data types of data in each Feature given in sparse_keys. Currently the [ParseExample](/versions/r2.2/api_docs/cc/class/tensorflow/ops/parse-example#classtensorflow_1_1ops_1_1_parse_example) supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).\n- dense_shapes: A list of Ndense shapes; the shapes of data in each Feature given in dense_keys. The number of elements in the Feature corresponding to dense_key\\[j\\] must always equal dense_shapes\\[j\\].NumEntries(). If dense_shapes\\[j\\] == (D0, D1, ..., DN) then the shape of output [Tensor](/versions/r2.2/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) dense_values\\[j\\] will be (\\|serialized\\|, D0, D1, ..., DN): The dense outputs are just the inputs row-stacked by batch. This works for dense_shapes\\[j\\] = (-1, D1, ..., DN). In this case the shape of the output [Tensor](/versions/r2.2/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) dense_values\\[j\\] will be (\\|serialized\\|, M, D1, .., DN), where M is the maximum number of blocks of elements of length D1 \\* .... \\* DN, across all minibatch entries in the input. [Any](/versions/r2.2/api_docs/cc/class/tensorflow/ops/any#classtensorflow_1_1ops_1_1_any) minibatch entry with less than M blocks of elements of length D1 \\* ... \\* DN will be padded with the corresponding default_value scalar element along the second dimension.\n\n\u003cbr /\u003e\n\nReturns:\n\n- `OutputList` sparse_indices\n- `OutputList` sparse_values\n- `OutputList` sparse_shapes\n- `OutputList` dense_values\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [ParseExample](#classtensorflow_1_1ops_1_1_parse_example_1abe97c3d8689593c4b7fc474df7232628)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` serialized, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` names, ::`[tensorflow::InputList](/versions/r2.2/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` sparse_keys, ::`[tensorflow::InputList](/versions/r2.2/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` dense_keys, ::`[tensorflow::InputList](/versions/r2.2/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` dense_defaults, const DataTypeSlice & sparse_types, const gtl::ArraySlice\u003c PartialTensorShape \u003e & dense_shapes)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|\n| [dense_values](#classtensorflow_1_1ops_1_1_parse_example_1a0621ad91c166916f20c4d8d38da78674) | `::`[tensorflow::OutputList](/versions/r2.2/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) |\n| [operation](#classtensorflow_1_1ops_1_1_parse_example_1a68504c285f005f993b30252db06fbee0) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [sparse_indices](#classtensorflow_1_1ops_1_1_parse_example_1a9f9016a149620b00fad16bff88591905) | `::`[tensorflow::OutputList](/versions/r2.2/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) |\n| [sparse_shapes](#classtensorflow_1_1ops_1_1_parse_example_1a39e169f2156ee03b9755c6e4b7bf9641) | `::`[tensorflow::OutputList](/versions/r2.2/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) |\n| [sparse_values](#classtensorflow_1_1ops_1_1_parse_example_1a39241716b69f84112f769ddf426c1a02) | `::`[tensorflow::OutputList](/versions/r2.2/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) |\n\nPublic attributes\n-----------------\n\n### dense_values\n\n```scdoc\n::tensorflow::OutputList dense_values\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\n### sparse_indices\n\n```scdoc\n::tensorflow::OutputList sparse_indices\n``` \n\n### sparse_shapes\n\n```scdoc\n::tensorflow::OutputList sparse_shapes\n``` \n\n### sparse_values\n\n```scdoc\n::tensorflow::OutputList sparse_values\n``` \n\nPublic functions\n----------------\n\n### ParseExample\n\n```gdscript\n ParseExample(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input serialized,\n ::tensorflow::Input names,\n ::tensorflow::InputList sparse_keys,\n ::tensorflow::InputList dense_keys,\n ::tensorflow::InputList dense_defaults,\n const DataTypeSlice & sparse_types,\n const gtl::ArraySlice\u003c PartialTensorShape \u003e & dense_shapes\n)\n```"]]