Class IntersectionShapingStrategy
- java.lang.Object
-
- org.tensorics.core.tensor.options.IntersectionShapingStrategy
-
- All Implemented Interfaces:
ManipulationOption
,Option<ManipulationOption>
,ShapingStrategy
public class IntersectionShapingStrategy extends java.lang.Object implements ShapingStrategy
A strategy for shaping tensors resulting from binary (element wise) operations, which just takes the intersection of both shapes. This means that the resulting shape will be such, that it will only contain positions which are contained in both incoming shapes.Example:
Shape result = shapeLeftRight(Shape.of(POS_A, POS_B), Shape.of(POS_B, POS_C)); result.equals(Shape.of(POS_B)); // would be true
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IntersectionShapingStrategy
get()
java.lang.Class<ShapingStrategy>
getMarkerInterface()
<C> Shape
shapeLeftRight(Tensor<?> left, Tensor<?> right)
Resulting tensor shape of given two in following formula: FIRST_TENSOR_SHAPE on SECOND_TENSOR_SHAPE
-
-
-
Method Detail
-
get
public static IntersectionShapingStrategy get()
-
shapeLeftRight
public <C> Shape shapeLeftRight(Tensor<?> left, Tensor<?> right)
Description copied from interface:ShapingStrategy
Resulting tensor shape of given two in following formula: FIRST_TENSOR_SHAPE on SECOND_TENSOR_SHAPE- Specified by:
shapeLeftRight
in interfaceShapingStrategy
- Parameters:
left
- tensorright
- tensor- Returns:
- resulting shape
-
getMarkerInterface
public java.lang.Class<ShapingStrategy> getMarkerInterface()
- Specified by:
getMarkerInterface
in interfaceOption<ManipulationOption>
-
-