Class TensorbackedInternals


  • public final class TensorbackedInternals
    extends java.lang.Object
    This class gives an access to the methods for Tensorbacked object support.
    • Method Detail

      • dimensionsOf

        public static <T extends Tensorbacked<?>> java.util.Set<java.lang.Class<?>> dimensionsOf​(java.lang.Class<T> tensorBackedClass)
        Retrieves the dimensions from the given class inheriting from tensor backed. This is done by inspecting the Dimensions annotation.
        Parameters:
        tensorBackedClass - the class for which to determine the dimensions
        Returns:
        the set of dimensions (classses of coordinates) which are required to create an instance of the given class.
      • createBackedByTensor

        public static <V,​T extends Tensorbacked<V>> T createBackedByTensor​(java.lang.Class<T> tensorBackedClass,
                                                                                 Tensor<V> tensor)
        Creates an instance of a class backed by a tensor.
        Parameters:
        tensorBackedClass - the type of the class for which to create an instance.
        tensor - the tensor to back the instance
        Returns:
        a new instance of the given class, backed by the given tensor
      • tensorsOf

        public static <S> java.lang.Iterable<Tensor<S>> tensorsOf​(java.lang.Iterable<? extends Tensorbacked<S>> tensorbackeds)
      • shapesOf

        public static final <TB extends Tensorbacked<?>> java.lang.Iterable<Shape> shapesOf​(java.lang.Iterable<TB> tensorbackeds)
      • classOf

        public static final <V,​TB extends Tensorbacked<V>> java.lang.Class<TB> classOf​(TB tensorBacked)
      • ensureExactTensorbackedDimensions

        public static <TB extends Tensorbacked<E>,​E> Tensor<E> ensureExactTensorbackedDimensions​(java.lang.Class<TB> tensorbackedClass,
                                                                                                       Tensor<E> tensor)