Class TensorValue


  • @Beta
    public class TensorValue
    extends Value
    A Value containing a tensor. See Tensor for definition of a tensor and the operations supported.
    Author:
    bratseth
    • Constructor Detail

      • TensorValue

        public TensorValue​(com.yahoo.tensor.Tensor value)
    • Method Detail

      • type

        public com.yahoo.tensor.TensorType type()
        Description copied from class: Value
        Returns the type of this value
        Specified by:
        type in class Value
      • asDouble

        public double asDouble()
        Description copied from class: Value
        Returns this value as a double, or throws UnsupportedOperationException if it cannot be represented as a double
        Specified by:
        asDouble in class Value
      • hasDouble

        public boolean hasDouble()
        Description copied from class: Value
        Returns true if this value can return itself as a double, i.e asDoubleValue will return a value and not throw
        Specified by:
        hasDouble in class Value
      • asBoolean

        public boolean asBoolean()
        Description copied from class: Value
        Returns this value as a boolean.
        Specified by:
        asBoolean in class Value
      • asTensor

        public com.yahoo.tensor.Tensor asTensor()
        Description copied from class: Value
        Returns this as a tensor value
        Specified by:
        asTensor in class Value
      • compare

        public Value compare​(TruthOperator operator,
                             Value argument)
        Description copied from class: Value
        Perform the comparison specified by the operator between this value and the given value
        Specified by:
        compare in class Value
      • function

        public Value function​(Function function,
                              Value arg)
        Description copied from class: Value
        Perform the given binary function on this value and the given value
        Specified by:
        function in class Value
      • asMutable

        public Value asMutable()
        Description copied from class: Value
        Returns this is mutable, or a mutable copy otherwise
        Specified by:
        asMutable in class Value
      • toString

        public java.lang.String toString()
        Specified by:
        toString in class Value
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in class Value
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class Value