Package deepboof
Interface ITensor
- All Known Subinterfaces:
ClippedPadding2D<T>,ConstantPadding2D<T>,SpatialPadding2D<T>,VTensor,VTensor_F32,VTensor_F64
- All Known Implementing Classes:
BaseSpatialPadding2D,BaseTensor,ClippedPadding2D_F32,ClippedPadding2D_F64,ConstantPadding2D_F32,ConstantPadding2D_F64,SpatialPadding2D_F32,SpatialPadding2D_F64,Tensor,Tensor_F32,Tensor_F64,Tensor_S32,Tensor_S64,Tensor_U8
public interface ITensor
Tensor Interface
-
Method Summary
Modifier and Type Method Description int[]createCoor()Creates a new coordinate for this tensor.java.lang.ClassgetDataType()Classof primitive data type used to store tensorintgetDimension()Returns the number of dimensions in the tensorint[]getShape()Returns the internal array that specifies the tensor's shape.booleanisShape(int... shape)Checks to see if the supplied shape is the same as the tensor's shapeintlength(int dimension)Returns the length of a dimension/axis.
-
Method Details
-
getShape
int[] getShape()Returns the internal array that specifies the tensor's shape. DO NOT MODIFIY- Returns:
- int[] array of the shape
-
isShape
boolean isShape(int... shape)Checks to see if the supplied shape is the same as the tensor's shape- Parameters:
shape- int[] which specifies the shape ofa tensor- Returns:
- true if the same or false if not
-
length
int length(int dimension)Returns the length of a dimension/axis. If a negative number is passed in it will return the distance relative to the end. E.g. -1 = length-1, -2 = length-2- Parameters:
dimension- The dimension/axis- Returns:
- length
-
createCoor
int[] createCoor()Creates a new coordinate for this tensor.- Returns:
- coordinate/int array of appropriate length
-
getDimension
int getDimension()Returns the number of dimensions in the tensor- Returns:
- number of dimensions
-
getDataType
java.lang.Class getDataType()Classof primitive data type used to store tensor- Returns:
- Internal data type class.
-