Class TensorWrappingOperation<V,​TB extends Tensorbacked<V>>

  • Type Parameters:
    V - the type of the values of the tensors and tensorbacked objects
    TB - the type of the tensorbacked objects into which tensors will be wrapped
    All Implemented Interfaces:
    java.util.function.Function<Tensor<V>,​TB>, Conversion<Tensor<V>,​TB>

    public class TensorWrappingOperation<V,​TB extends Tensorbacked<V>>
    extends java.lang.Object
    implements Conversion<Tensor<V>,​TB>
    The default implementation of an operation, which wraps a tensor into a tensorbacked object of a given type.
    • Constructor Summary

      Constructors 
      Constructor Description
      TensorWrappingOperation​(java.lang.Class<TB> tensorbackedClass)
      The constructor, which requires a class which can wrap tensors
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TB apply​(Tensor<V> tensor)
      Has to implement the conversion logic to convert the given object into an object of type R.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Constructor Detail

      • TensorWrappingOperation

        public TensorWrappingOperation​(java.lang.Class<TB> tensorbackedClass)
        The constructor, which requires a class which can wrap tensors
        Parameters:
        tensorbackedClass - the type of the tensorbacked objects that will be created
    • Method Detail

      • apply

        public TB apply​(Tensor<V> tensor)
        Description copied from interface: Conversion
        Has to implement the conversion logic to convert the given object into an object of type R.
        Specified by:
        apply in interface Conversion<V,​TB extends Tensorbacked<V>>
        Specified by:
        apply in interface java.util.function.Function<V,​TB extends Tensorbacked<V>>
        Parameters:
        tensor - the object to convert
        Returns:
        an object of the correct return type.