تدفق التوتر:: العمليات:: فك تشفير CSV
#include <parsing_ops.h>
تحويل سجلات CSV إلى موترات.
ملخص
يعيّن كل عمود موترًا واحدًا.
من المتوقع أن يكون تنسيق RFC 4180 لسجلات CSV. ( https://tools.ietf.org/html/rfc4180 ) لاحظ أننا نسمح بمسافات بادئة وزائدة باستخدام حقل int أو float.
الحجج:
- النطاق: كائن النطاق
- السجلات: كل سلسلة عبارة عن سجل/صف في ملف CSV ويجب أن يكون لجميع السجلات نفس التنسيق.
- Record_defaults: موتر واحد لكل عمود من سجل الإدخال، إما بقيمة عددية افتراضية لذلك العمود أو بمتجه فارغ إذا كان العمود مطلوبًا.
السمات الاختيارية (انظر Attrs
):
- field_delim: محدد الحرف لفصل الحقول في السجل.
- use_quote_delim: إذا كان خطأ، يتم التعامل مع علامات الاقتباس المزدوجة كأحرف عادية داخل حقول السلسلة (تجاهل RFC 4180، القسم 2، الرمز النقطي 5).
- na_value: سلسلة إضافية للتعرف عليها كـ NA/NaN.
العوائد:
-
OutputList
: سيكون لكل موتر نفس شكل السجلات.
البنائين والمدمرين | |
---|---|
DecodeCSV (const :: tensorflow::Scope & scope, :: tensorflow::Input records, :: tensorflow::InputList record_defaults) | |
DecodeCSV (const :: tensorflow::Scope & scope, :: tensorflow::Input records, :: tensorflow::InputList record_defaults, const DecodeCSV::Attrs & attrs) |
الصفات العامة | |
---|---|
operation | |
output |
الوظائف العامة | |
---|---|
operator[] (size_t index) const |
وظائف ثابتة العامة | |
---|---|
FieldDelim (StringPiece x) | |
NaValue (StringPiece x) | |
SelectCols (const gtl::ArraySlice< int > & x) | |
UseQuoteDelim (bool x) |
الهياكل | |
---|---|
Tensorflow:: ops:: DecodeCSV:: Attrs | محددات السمات الاختيارية لـ DecodeCSV . |
الصفات العامة
عملية
Operation operation
الإخراج
::tensorflow::OutputList output
الوظائف العامة
فك تشفير CSV
DecodeCSV( const ::tensorflow::Scope & scope, ::tensorflow::Input records, ::tensorflow::InputList record_defaults )
فك تشفير CSV
DecodeCSV( const ::tensorflow::Scope & scope, ::tensorflow::Input records, ::tensorflow::InputList record_defaults, const DecodeCSV::Attrs & attrs )
عامل التشغيل[]
::tensorflow::Output operator[]( size_t index ) const
وظائف ثابتة العامة
فيلدديليم
Attrs FieldDelim( StringPiece x )
قيمة نافية
Attrs NaValue( StringPiece x )
حدد كولز
Attrs SelectCols( const gtl::ArraySlice< int > & x )
UseQuoteDelim
Attrs UseQuoteDelim( bool x )
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# tensorflow::ops::DecodeCSV Class Reference\n\ntensorflow::ops::DecodeCSV\n==========================\n\n`#include \u003cparsing_ops.h\u003e`\n\nConvert CSV records to tensors.\n\nSummary\n-------\n\nEach column maps to one tensor.\n\nRFC 4180 format is expected for the CSV records. (\u003chttps://tools.ietf.org/html/rfc4180\u003e) Note that we allow leading and trailing spaces with int or float field.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- records: Each string is a record/row in the csv and all records should have the same format.\n- record_defaults: One tensor per column of the input record, with either a scalar default value for that column or an empty vector if the column is required.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)):\n\n- field_delim: char delimiter to separate fields in a record.\n- use_quote_delim: If false, treats double quotation marks as regular characters inside of the string fields (ignoring RFC 4180, Section 2, Bullet 5).\n- na_value: Additional string to recognize as NA/NaN.\n\n\u003cbr /\u003e\n\nReturns:\n\n- `OutputList`: Each tensor will have the same shape as records.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [DecodeCSV](#classtensorflow_1_1ops_1_1_decode_c_s_v_1abb564f0f8635299e4d247579c3573a82)`(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)` records, ::`[tensorflow::InputList](/versions/r2.2/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` record_defaults)` ||\n| [DecodeCSV](#classtensorflow_1_1ops_1_1_decode_c_s_v_1ae32db75a692e4afe6b70cc30598e4011)`(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)` records, ::`[tensorflow::InputList](/versions/r2.2/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` record_defaults, const `[DecodeCSV::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_decode_c_s_v_1a724a3cdf473b012d0b0ba7d76671ef50) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_decode_c_s_v_1af13fac27cc90a9988b6f3130be188b14) | `::`[tensorflow::OutputList](/versions/r2.2/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) |\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operator[]](#classtensorflow_1_1ops_1_1_decode_c_s_v_1aba6179f5920348d20cc574fa0921ae82)`(size_t index) const ` | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|\n| [FieldDelim](#classtensorflow_1_1ops_1_1_decode_c_s_v_1a783b3fcdf01d0b499e1a5f72a5b042a2)`(StringPiece x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs) |\n| [NaValue](#classtensorflow_1_1ops_1_1_decode_c_s_v_1a357f7eec9a91b48588facfab257e46a5)`(StringPiece x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs) |\n| [SelectCols](#classtensorflow_1_1ops_1_1_decode_c_s_v_1a08cc36204d26ff6e6cd736a7d4a1e43b)`(const gtl::ArraySlice\u003c int \u003e & x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs) |\n| [UseQuoteDelim](#classtensorflow_1_1ops_1_1_decode_c_s_v_1aa67991c469762771d5aa77050b8808a3)`(bool x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::DecodeCSV::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/decode-c-s-v/attrs) | Optional attribute setters for [DecodeCSV](/versions/r2.2/api_docs/cc/class/tensorflow/ops/decode-c-s-v#classtensorflow_1_1ops_1_1_decode_c_s_v). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::OutputList output\n``` \n\nPublic functions\n----------------\n\n### DecodeCSV\n\n```gdscript\n DecodeCSV(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input records,\n ::tensorflow::InputList record_defaults\n)\n``` \n\n### DecodeCSV\n\n```gdscript\n DecodeCSV(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input records,\n ::tensorflow::InputList record_defaults,\n const DecodeCSV::Attrs & attrs\n)\n``` \n\n### operator\\[\\]\n\n```gdscript\n::tensorflow::Output operator[](\n size_t index\n) const \n``` \n\nPublic static functions\n-----------------------\n\n### FieldDelim\n\n```text\nAttrs FieldDelim(\n StringPiece x\n)\n``` \n\n### NaValue\n\n```text\nAttrs NaValue(\n StringPiece x\n)\n``` \n\n### SelectCols\n\n```gdscript\nAttrs SelectCols(\n const gtl::ArraySlice\u003c int \u003e & x\n)\n``` \n\n### UseQuoteDelim\n\n```text\nAttrs UseQuoteDelim(\n bool x\n)\n```"]]