Package deepboof.tensors
Class Tensor_U8
- All Implemented Interfaces:
ITensor
public class Tensor_U8 extends Tensor<Tensor_U8>
-
Field Summary
Fields Modifier and Type Field Description byte[]dFields inherited from class deepboof.Tensor
startIndex, strides, subtensorFields inherited from class deepboof.BaseTensor
shape -
Constructor Summary
-
Method Summary
Modifier and Type Method Description Tensor_U8create(int... shape)Creates a tensor of the same type with the specified shapeObjectgetData()Returns internal array used to store tensor data.ClassgetDataType()Classof primitive data type used to store tensordoublegetDouble(int... coordinate)Accessor function which allows any tensor's element to be read as a double.protected voidinnerArrayGrow(int N)Re-declare inner array so that it is at least of length Nprotected intinnerArrayLength()Length of inner array as returned by "data.length"voidsetData(Object data)Used to change the internal array in an abstract waystatic Tensor_U8wrap(byte[] data, int... shape)voidzero()Sets all elements in the tensor to the value of zeroMethods inherited from class deepboof.Tensor
computeStrides, copy, copyShape, createCoor, createLike, idx, idx, idx, idx, idx, idx, indexToCoor, isSub, length, length, reshape, reshape, reshape, reshape, reshape, reshape, reshape, setTo, stride, subtensorMethods inherited from class deepboof.BaseTensor
getDimension, getShape, isShape
-
Field Details
-
d
public byte[] d
-
-
Constructor Details
-
Tensor_U8
public Tensor_U8(int... shape) -
Tensor_U8
public Tensor_U8()
-
-
Method Details
-
wrap
-
getDouble
public double getDouble(int... coordinate)Description copied from class:TensorAccessor function which allows any tensor's element to be read as a double. -
getData
Description copied from class:TensorReturns internal array used to store tensor data. Data is stored in a row-major order in a single array. -
setData
Description copied from class:TensorUsed to change the internal array in an abstract way -
innerArrayGrow
protected void innerArrayGrow(int N)Description copied from class:TensorRe-declare inner array so that it is at least of length N- Specified by:
innerArrayGrowin classTensor<Tensor_U8>- Parameters:
N- Desired minimum length of inner array
-
innerArrayLength
protected int innerArrayLength()Description copied from class:TensorLength of inner array as returned by "data.length"- Specified by:
innerArrayLengthin classTensor<Tensor_U8>- Returns:
- Length of inner array
-
create
Description copied from class:TensorCreates a tensor of the same type with the specified shape -
zero
public void zero()Description copied from class:TensorSets all elements in the tensor to the value of zero -
getDataType
Description copied from interface:ITensorClassof primitive data type used to store tensor- Returns:
- Internal data type class.
-