Class CoercingTensorData

java.lang.Object
com.linkedin.feathr.common.CoercingTensorData
All Implemented Interfaces:
TensorData

public class CoercingTensorData extends Object implements TensorData
Coerce types in any TensorData to the one requested by the client.
  • Constructor Details

    • CoercingTensorData

      public CoercingTensorData(TensorData inner)
  • Method Details

    • getTypes

      public Representable[] getTypes()
      Specified by:
      getTypes in interface TensorData
      Returns:
      the types of all dimensions and the value as a single array.
    • estimatedCardinality

      public int estimatedCardinality()
      Specified by:
      estimatedCardinality in interface TensorData
      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:
      cardinality in interface TensorData
      Returns:
      exact number of entries in the mapping from dimensions to values.
    • iterator

      public TensorIterator iterator()
      Specified by:
      iterator in interface TensorData
      Returns:
      an iterator over entries in the mapping from dimensions to the value.
    • getShape

      public long[] getShape()
      Specified by:
      getShape in interface TensorData
      Returns:
      the current shape of the data or the supplied shape of the data
    • getInner

      public TensorData getInner()