tensorflow::ops::DecodeCSV

#include <parsing_ops.h>

Convert CSV records to tensors.

Summary

Each column maps to one tensor.

RFC 4180 format is expected for the CSV records. (https://tools.ietf.org/html/rfc4180) Note that we allow leading and trailing spaces with int or float field.

Arguments:

  • scope: A Scope object
  • records: Each string is a record/row in the csv and all records should have the same format.
  • 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.

Optional attributes (see Attrs):

  • field_delim: char delimiter to separate fields in a record.
  • use_quote_delim: If false, treats double quotation marks as regular characters inside of the string fields (ignoring RFC 4180, Section 2, Bullet 5).
  • na_value: Additional string to recognize as NA/NaN.

Returns:

  • OutputList: Each tensor will have the same shape as records.
Constructors and Destructors
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)
Public attributes
operation
output
Public functions
operator[](size_t index) const
Public static functions
FieldDelim(StringPiece x)
NaValue(StringPiece x)
SelectCols(const gtl::ArraySlice< int > & x)
UseQuoteDelim(bool x)
Structs
tensorflow::ops::DecodeCSV::Attrs

Optional attribute setters for DecodeCSV.

Public attributes

operation

Operation operation

output

::tensorflow::OutputList output

Public functions

DecodeCSV

 DecodeCSV(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input records,
  ::tensorflow::InputList record_defaults
)

DecodeCSV

 DecodeCSV(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input records,
  ::tensorflow::InputList record_defaults,
  const DecodeCSV::Attrs & attrs
)

operator[]

::tensorflow::Output operator[](
  size_t index
) const 

Public static functions

FieldDelim

Attrs FieldDelim(
  StringPiece x
)
Attrs NaValue(
  StringPiece x
)

SelectCols

Attrs SelectCols(
  const gtl::ArraySlice< int > & x
)

UseQuoteDelim

Attrs UseQuoteDelim(
  bool x
)

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/cc/class/tensorflow/ops/decode-c-s-v