DecodeCsv

Stay organized with collections Save and categorize content based on your preferences.
public final class DecodeCsv

Convert CSV records to tensors. 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.

Nested Classes

class DecodeCsv.Options Optional attributes for DecodeCsv  

Constants

String OP_NAME The name of this op, as known by TensorFlow core engine

Public Methods

static DecodeCsv
create(Scope scope, Operand<TString> records, Iterable<Operand<?>> recordDefaults, Options... options)
Factory method to create a class wrapping a new DecodeCsv operation.
static DecodeCsv.Options
fieldDelim(String fieldDelim)
Iterator<Operand<TType>>
static DecodeCsv.Options
naValue(String naValue)
List<Output<?>>
output()
Each tensor will have the same shape as records.
static DecodeCsv.Options
selectCols(List<Long> selectCols)
static DecodeCsv.Options
useQuoteDelim(Boolean useQuoteDelim)

Inherited Methods

Constants

public static final String OP_NAME

The name of this op, as known by TensorFlow core engine

Constant Value: "DecodeCSV"

Public Methods

public static DecodeCsv create (Scope scope, Operand<TString> records, Iterable<Operand<?>> recordDefaults, Options... options)

Factory method to create a class wrapping a new DecodeCsv operation.

Parameters
scope current scope
records Each string is a record/row in the csv and all records should have the same format.
recordDefaults 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.
options carries optional attributes values
Returns
  • a new instance of DecodeCsv

public static DecodeCsv.Options fieldDelim (String fieldDelim)

Parameters
fieldDelim char delimiter to separate fields in a record.

public Iterator<Operand<TType>> iterator ()

public static DecodeCsv.Options naValue (String naValue)

Parameters
naValue Additional string to recognize as NA/NaN.

public List<Output<?>> output ()

Each tensor will have the same shape as records.

public static DecodeCsv.Options selectCols (List<Long> selectCols)

public static DecodeCsv.Options useQuoteDelim (Boolean useQuoteDelim)

Parameters
useQuoteDelim If false, treats double quotation marks as regular characters inside of the string fields (ignoring RFC 4180, Section 2, Bullet 5).