Class TensorType.Builder

  • Enclosing class:
    TensorType

    public static class TensorType.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
        Creates an empty builder with cells of type double
      • Builder

        public Builder​(TensorType... types)
        Creates a builder containing a combination of the dimensions of the given types If the same dimension is indexed with different size restrictions the smallest size will be used. If it is size restricted in one argument but not the other it will not be size restricted. If it is indexed in one and mapped in the other it will become mapped. The value type will be the largest of the value types of the input types
      • Builder

        public Builder​(boolean allowDifferentSizes,
                       TensorType... types)
      • Builder

        public Builder​(java.lang.Iterable<TensorType.Dimension> dimensions)
        Creates a builder from the given dimensions, having double as the value type
    • Method Detail

      • rank

        public int rank()
        Returns the current number of dimensions in this
      • indexed

        public TensorType.Builder indexed​(java.lang.String name,
                                          long size)
        Adds a bound indexed dimension to this
        Throws:
        java.lang.IllegalArgumentException - if the dimension is already present
      • indexed

        public TensorType.Builder indexed​(java.lang.String name)
        Adds an unbound indexed dimension to this
        Throws:
        java.lang.IllegalArgumentException - if the dimension is already present
      • mapped

        public TensorType.Builder mapped​(java.lang.String name)
        Adds a mapped dimension to this
        Throws:
        java.lang.IllegalArgumentException - if the dimension is already present
      • getDimension

        public java.util.Optional<TensorType.Dimension> getDimension​(java.lang.String dimension)
        Returns the given dimension, or empty if none is present