جریان تنسور:: عملیات:: ParseSingleExample
#include <parsing_ops.h>
یک پروتو tf.Example (به عنوان یک رشته) را به تانسورهای تایپ شده تبدیل می کند.
خلاصه
استدلال ها:
- scope: یک شی Scope
- serialized: بردار حاوی دستهای از پروتوهای نمونه سریالسازی شده باینری.
- dense_defaults: فهرستی از تانسورها (بعضی ممکن است خالی باشند)، که طول آنها با طول
dense_keys
مطابقت دارد. dense_defaults[j] مقادیر پیشفرض را زمانی ارائه میکند که feature_map مثال فاقد کلید [j] متراکم باشد. اگر یک تانسور خالی برای dense_defaults[j] ارائه شده باشد، سپس Feature dense_keys[j] مورد نیاز است. نوع ورودی از dense_defaults[j] استنباط می شود، حتی زمانی که خالی است. اگر dense_defaults[j] خالی نباشد، و dense_shapes[j] کاملاً تعریف شده باشد، شکل dense_defaults[j] باید با شکل dense_shapes[j] مطابقت داشته باشد. اگر dense_shapes[j] یک بعد اصلی تعریفنشده دارد (ویژگی متراکم گامهای متغیر)، dense_defaults[j] باید یک عنصر واحد داشته باشد: عنصر padding. - num_sparse: تعداد ویژگی های پراکنده ای که باید از مثال تجزیه شوند. این باید با طول
sparse_keys
وsparse_types
مطابقت داشته باشد. - sparse_keys: لیستی از رشته های
num_sparse
. کلیدهای مورد انتظار در ویژگیهای Examples مرتبط با مقادیر پراکنده هستند. - dense_keys: کلیدهای مورد انتظار در ویژگی های Examples مرتبط با مقادیر متراکم.
- sparse_types: لیستی از انواع
num_sparse
. انواع داده های داده در هر ویژگی که در کلیدهای پراکنده ارائه شده است. در حال حاضر عملیات ParseSingleExample از DT_FLOAT (FloatList)، DT_INT64 (Int64List) و DT_STRING (BytesList) پشتیبانی می کند. - dense_shapes: شکل داده ها در هر ویژگی که به صورت dense_keys ارائه می شود. طول این لیست باید با طول
dense_keys
مطابقت داشته باشد. تعداد عناصر موجود در Feature مربوط به dense_key[j] باید همیشه برابر با dense_shapes[j] باشد.NumEntries(). اگر شکلهای متراکم[j] == (D0، D1، ...، DN) شکل تانسورهای خروجی [j] به صورت (D0، D1، ...، DN) خواهد بود: در مورد شکلهای متراکم[j] = (-1، D1، ...، DN)، شکل تانسور خروجی مقادیر_ متراکم [j] خواهد بود (M، D1، ..، DN)، که در آن M تعداد بلوک های عناصر با طول D1 * است. ... * DN، در ورودی.
برمی گرداند:
-
OutputList
sparse_indexes -
OutputList
sparse_values -
OutputList
sparse_shapes -
OutputList
dense_values
سازندگان و ویرانگرها | |
---|---|
ParseSingleExample (const :: tensorflow::Scope & scope, :: tensorflow::Input serialized, :: tensorflow::InputList dense_defaults, int64 num_sparse, const gtl::ArraySlice<::tensorflow::tstring > & sparse_keys, const gtl::ArraySlice<::tensorflow::tstring > & dense_keys, const DataTypeSlice & sparse_types, const gtl::ArraySlice< PartialTensorShape > & dense_shapes) |
صفات عمومی | |
---|---|
dense_values | |
operation | |
sparse_indices | |
sparse_shapes | |
sparse_values |
صفات عمومی
ارزش های متراکم
::tensorflow::OutputList dense_values
عملیات
Operation operation
اندیس_های پراکنده
::tensorflow::OutputList sparse_indices
شکل های پراکنده
::tensorflow::OutputList sparse_shapes
مقادیر_کم
::tensorflow::OutputList sparse_values
توابع عمومی
ParseSingleExample
ParseSingleExample( const ::tensorflow::Scope & scope, ::tensorflow::Input serialized, ::tensorflow::InputList dense_defaults, int64 num_sparse, const gtl::ArraySlice<::tensorflow::tstring > & sparse_keys, const gtl::ArraySlice<::tensorflow::tstring > & dense_keys, const DataTypeSlice & sparse_types, const gtl::ArraySlice< PartialTensorShape > & dense_shapes )
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-27 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-27 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# tensorflow::ops::ParseSingleExample Class Reference\n\ntensorflow::ops::ParseSingleExample\n===================================\n\n`#include \u003cparsing_ops.h\u003e`\n\nTransforms a tf.Example proto (as a string) into typed tensors.\n\nSummary\n-------\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- serialized: A vector containing a batch of binary serialized Example protos.\n- dense_defaults: A list of Tensors (some may be empty), whose length matches the length of `dense_keys`. dense_defaults\\[j\\] provides default values when the example's feature_map lacks dense_key\\[j\\]. If an empty [Tensor](/versions/r2.3/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- num_sparse: The number of sparse features to be parsed from the example. This must match the lengths of `sparse_keys` and `sparse_types`.\n- sparse_keys: A list of `num_sparse` strings. The keys expected in the Examples' features associated with sparse values.\n- dense_keys: The keys expected in the Examples' features associated with dense values.\n- sparse_types: A list of `num_sparse` types; the data types of data in each Feature given in sparse_keys. Currently the [ParseSingleExample](/versions/r2.3/api_docs/cc/class/tensorflow/ops/parse-single-example#classtensorflow_1_1ops_1_1_parse_single_example) op supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).\n- dense_shapes: The shapes of data in each Feature given in dense_keys. The length of this list must match the length of `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.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) dense_values\\[j\\] will be (D0, D1, ..., DN): In the case dense_shapes\\[j\\] = (-1, D1, ..., DN), the shape of the output [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) dense_values\\[j\\] will be (M, D1, .., DN), where M is the number of blocks of elements of length D1 \\* .... \\* DN, in the input.\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| [ParseSingleExample](#classtensorflow_1_1ops_1_1_parse_single_example_1a2907d81d498acfa5ffbe97b70859a6ac)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` serialized, ::`[tensorflow::InputList](/versions/r2.3/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` dense_defaults, int64 num_sparse, const gtl::ArraySlice\u003c::tensorflow::tstring \u003e & sparse_keys, const gtl::ArraySlice\u003c::tensorflow::tstring \u003e & dense_keys, 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_single_example_1a47aea5050a1c195f45e106a7e5dd8d6c) | `::`[tensorflow::OutputList](/versions/r2.3/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) |\n| [operation](#classtensorflow_1_1ops_1_1_parse_single_example_1a653e666e79f4a510ce99022030457306) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [sparse_indices](#classtensorflow_1_1ops_1_1_parse_single_example_1aff26528d71218f864c4bbe158da75497) | `::`[tensorflow::OutputList](/versions/r2.3/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) |\n| [sparse_shapes](#classtensorflow_1_1ops_1_1_parse_single_example_1a43c18746bd9c93c475b6f796e90cf197) | `::`[tensorflow::OutputList](/versions/r2.3/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) |\n| [sparse_values](#classtensorflow_1_1ops_1_1_parse_single_example_1a0dbd7fd1ac19943db8a06f1004a43731) | `::`[tensorflow::OutputList](/versions/r2.3/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### ParseSingleExample\n\n```gdscript\n ParseSingleExample(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input serialized,\n ::tensorflow::InputList dense_defaults,\n int64 num_sparse,\n const gtl::ArraySlice\u003c::tensorflow::tstring \u003e & sparse_keys,\n const gtl::ArraySlice\u003c::tensorflow::tstring \u003e & dense_keys,\n const DataTypeSlice & sparse_types,\n const gtl::ArraySlice\u003c PartialTensorShape \u003e & dense_shapes\n)\n```"]]