Interface TensorIterator
- All Superinterfaces:
ReadableTuple
- All Known Implementing Classes:
BaseDenseTensorIterator
TensorIterator is responsible for a range of rows (possibly empty).
At every moment of time, one row is current (zero if the range is empty).
Both dimensions and the value of the current row are available via getters.
Getters of column values are specialized for primitive types to save on an additional object allocation/dereferencing.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleangetBoolean(int column) default byte[]getBytes(int column) getCopy()default doublegetDouble(int column) default StringgetString(int column) default Representable[]getTypes()getValue(int column) Deprecated.this should not be usedbooleanisValid()voidnext()Move iterator to the next row.voidstart()Rewinds the iterator to the beginning of its range.Methods inherited from interface com.linkedin.feathr.common.tensor.ReadableTuple
getFloat, getInt, getLong
-
Method Details
-
getTensorData
TensorData getTensorData() -
start
void start()Rewinds the iterator to the beginning of its range. -
isValid
boolean isValid()- Returns:
- if the iterator is still within its range.
-
next
void next()Move iterator to the next row. -
getCopy
TensorIterator getCopy()- Specified by:
getCopyin interfaceReadableTuple- Returns:
- a copy of the iterator at the current position. Can be used to return to a previously visited position.
-
getValue
Deprecated.this should not be usedOriginally created for ease of debugging. Should NOT be used for returning arbitrary objects, only for primitives. -
getString
- Specified by:
getStringin interfaceReadableTuple- Returns:
- a String at given column (dimension or value).
-
getDouble
default double getDouble(int column) - Specified by:
getDoublein interfaceReadableTuple- Returns:
- a double at given column (dimension or value).
-
getBoolean
default boolean getBoolean(int column) - Specified by:
getBooleanin interfaceReadableTuple- Returns:
- a boolean at given column (dimension or value)
-
getBytes
default byte[] getBytes(int column) - Specified by:
getBytesin interfaceReadableTuple- Returns:
- a byte array at given column (dimension or value)
-
getTypes
- Specified by:
getTypesin interfaceReadableTuple
-