จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: แยกตัวอย่าง
#include <parsing_ops.h>
แปลงเวกเตอร์ของสมอง ตัวอย่างโปรโตส (เป็นสตริง) เป็นเทนเซอร์ที่พิมพ์
สรุป
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- ทำให้เป็นอนุกรม: เวกเตอร์ที่มีชุดของโปรโตตัวอย่างที่เป็นอนุกรมแบบไบนารี
- ชื่อ: เวกเตอร์ที่มีชื่อของโปรโตที่ต่อเนื่องกัน อาจมี ตัวอย่างเช่น ชื่อคีย์ตาราง (คำอธิบาย) สำหรับโปรโตที่ต่อเนื่องกัน สิ่งเหล่านี้มีประโยชน์สำหรับวัตถุประสงค์ในการแก้ไขจุดบกพร่องเท่านั้น และการมีค่าอยู่ที่นี่ไม่มีผลกระทบต่อเอาต์พุต อาจเป็นเวกเตอร์เปล่าก็ได้หากไม่มีชื่อ หากไม่ว่างเปล่า เวกเตอร์นี้จะต้องมีความยาวเท่ากับ "อนุกรม"
- sparse_keys: รายการสตริงเทนเซอร์ Nsparse (สเกลาร์) คีย์ที่คาดหวังในคุณสมบัติของตัวอย่างที่เกี่ยวข้องกับค่ากระจัดกระจาย
- หนาแน่น_คีย์: รายการเทนเซอร์สตริง Ndense (สเกลาร์) คีย์ที่คาดหวังในคุณลักษณะของตัวอย่างที่เกี่ยวข้องกับค่าหนาแน่น
- หนาแน่น_ค่าเริ่มต้น: รายการ Ndense Tensors (บางส่วนอาจว่างเปล่า) หนาแน่น_defaults[j] ให้ค่าเริ่มต้นเมื่อ Feature_map ของตัวอย่างไม่มีหนาแน่น_key[j] หากมีการระบุ Tensor ว่างไว้สำหรับหนาแน่น_ค่าเริ่มต้น[j] แสดงว่าจำเป็นต้องมีคุณลักษณะหนาแน่น_keys[j] ประเภทอินพุตจะอนุมานจากหนาแน่น_defaults[j] แม้ว่าจะว่างเปล่าก็ตาม หากหนาแน่น_defaults[j] ไม่ว่างเปล่า และหนาแน่น_รูปร่าง[j] ถูกกำหนดไว้อย่างสมบูรณ์ ดังนั้นรูปร่างของหนาแน่น_defaults[j] จะต้องตรงกับรูปร่างของหนาแน่น_รูปร่าง[j] หากหนาแน่น_รูปร่าง[j] มีมิติหลักที่ไม่ได้กำหนดไว้ (คุณลักษณะความหนาแน่นของความก้าวหน้าแบบแปรผัน)หนาแน่น_ค่าเริ่มต้น[j] จะต้องมีองค์ประกอบเดียว: องค์ประกอบช่องว่างภายใน
- sparse_types: รายการประเภท Nsparse; ประเภทข้อมูลของข้อมูลในแต่ละคุณสมบัติที่กำหนดใน sparse_keys ปัจจุบัน ParseExample รองรับ DT_FLOAT (FloatList), DT_INT64 (Int64List) และ DT_STRING (BytesList)
- Dense_shapes: รายการรูปร่าง Ndense; รูปร่างของข้อมูลในแต่ละฟีเจอร์ที่กำหนดในหนาแน่น_คีย์ จำนวนองค์ประกอบในฟีเจอร์ที่สอดคล้องกับหนาแน่น_คีย์[j] จะต้องเท่ากับหนาแน่น_รูปร่าง[j].NumEntries() เสมอ หากหนาแน่น_รูปร่าง[j] == (D0, D1, ..., DN) ดังนั้นรูปร่างของเอาท์พุต เทนเซอร์ หนาแน่น_ค่า[j] จะเป็น (|ซีเรียลไลซ์|, D0, D1, ..., DN): เอาท์พุตที่มีความหนาแน่นสูงนั้น เพียงแถวอินพุตเรียงซ้อนตามแบทช์ วิธีนี้ใช้ได้กับหนาแน่น_รูปร่าง[j] = (-1, D1, ..., DN) ในกรณีนี้ รูปร่างของเอาท์พุต Tensor หนาแน่น_ค่า[j] จะเป็น (|อนุกรม|, M, D1, .., DN) โดยที่ M คือจำนวนบล็อกสูงสุดขององค์ประกอบที่มีความยาว D1 * .... * DN ในรายการมินิแบทช์ทั้งหมดในอินพุต รายการมินิแบทช์ ใดๆ ที่มีองค์ประกอบความยาวน้อยกว่า M บล็อก D1 * ... * DN จะถูกเสริมด้วยองค์ประกอบสเกลาร์ default_value ที่สอดคล้องกันตลอดมิติที่สอง
ผลตอบแทน:
-
OutputList
-
OutputList
-
OutputList
-
OutputList
หนาแน่น_ค่า
คุณลักษณะสาธารณะ
งานสาธารณะ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[null,null,["อัปเดตล่าสุด 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```"]]