Class TensorWrappingOperation<V,TB extends Tensorbacked<V>>
- java.lang.Object
-
- org.tensorics.core.tensorbacked.operations.TensorWrappingOperation<V,TB>
-
- Type Parameters:
V
- the type of the values of the tensors and tensorbacked objectsTB
- 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.
-
-
-
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 interfaceConversion<V,TB extends Tensorbacked<V>>
- Specified by:
apply
in interfacejava.util.function.Function<V,TB extends Tensorbacked<V>>
- Parameters:
tensor
- the object to convert- Returns:
- an object of the correct return type.
-
-