W3cubDocs

/TensorFlow C++

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 empty 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
output
Public functions
operator[](size_t index) const
Public static functions
FieldDelim(StringPiece x)
NaValue(StringPiece x)
UseQuoteDelim(bool x)
Structs
tensorflow::ops::DecodeCSV::Attrs

Optional attribute setters for DecodeCSV.

Public attributes

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
)

NaValue

Attrs NaValue(
  StringPiece x
)

UseQuoteDelim

Attrs UseQuoteDelim(
  bool x
)

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