Class ByteBufferDenseTensor
java.lang.Object
com.linkedin.feathr.common.tensor.DenseTensor
com.linkedin.feathr.common.tensor.dense.ByteBufferDenseTensor
- All Implemented Interfaces:
TensorData
- Direct Known Subclasses:
DenseBooleanTensor,DenseBytesTensor,DenseDoubleTensor,DenseFloatTensor,DenseIntTensor,DenseLongTensor,DenseStringTensor
Base class for dense int/float/double/long/boolean/string/byte[] tensors backed by a ByteBuffer using TensorFlow-compatible layout.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ByteBufferprotected final intprotected final intprotected final long[]protected final intprotected final Representable[] -
Constructor Summary
ConstructorsConstructorDescriptionByteBufferDenseTensor(ByteBuffer byteBuffer, long[] shape, Primitive type, int bytes) -
Method Summary
Modifier and TypeMethodDescriptionintintgetByteBuffer(boolean makeCopy) long[]getShape()getTypes()Methods inherited from class com.linkedin.feathr.common.tensor.DenseTensor
asListMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linkedin.feathr.common.tensor.TensorData
getArity, isEmpty, iterator
-
Field Details
-
_byteBuffer
-
_start
protected final int _start -
_limit
protected final int _limit -
_shape
protected final long[] _shape -
_cardinality
protected final int _cardinality -
_types
-
-
Constructor Details
-
ByteBufferDenseTensor
-
-
Method Details
-
getByteBuffer
-
getByteBuffer
-
getShape
public long[] getShape()- Returns:
- the current shape of the data or the supplied shape of the data
-
getTypes
- Returns:
- the types of all dimensions and the value as a single array.
-
estimatedCardinality
public int estimatedCardinality()- Returns:
- conservative estimate of number of entries in the mapping from dimensions to values. Can be cheaper to evaluate than the exact one.
-
cardinality
public int cardinality()- Returns:
- exact number of entries in the mapping from dimensions to values.
-