Class ScalarTensor
java.lang.Object
com.linkedin.feathr.common.tensor.scalar.ScalarTensor
- All Implemented Interfaces:
TensorData
- Direct Known Subclasses:
ScalarBooleanTensor,ScalarBytesTensor,ScalarDoubleTensor,ScalarFloatTensor,ScalarIntTensor,ScalarLongTensor,ScalarStringTensor
A base for all wrappers of scalars.
Has arity of 1: 0 dimensions and 1 value. Cardinality is always 1.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintlong[]getShape()protected final PrimitivegetType()static ScalarTensorstatic ScalarTensorMethods 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, getTypes, isEmpty, iterator
-
Constructor Details
-
ScalarTensor
public ScalarTensor()
-
-
Method Details
-
wrap
-
wrap
-
getType
-
estimatedCardinality
public int estimatedCardinality()- Specified by:
estimatedCardinalityin interfaceTensorData- 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()- Specified by:
cardinalityin interfaceTensorData- Returns:
- exact number of entries in the mapping from dimensions to values.
-
getShape
public long[] getShape()- Specified by:
getShapein interfaceTensorData- Returns:
- the current shape of the data or the supplied shape of the data
-