Class Tensor_U8

All Implemented Interfaces:
ITensor

public class Tensor_U8 extends Tensor<Tensor_U8>
  • Field Details

    • d

      public byte[] d
  • Constructor Details

    • Tensor_U8

      public Tensor_U8(int... shape)
    • Tensor_U8

      public Tensor_U8()
  • Method Details

    • wrap

      public static Tensor_U8 wrap(byte[] data, int... shape)
    • getDouble

      public double getDouble(int... coordinate)
      Description copied from class: Tensor
      Accessor function which allows any tensor's element to be read as a double.
      Specified by:
      getDouble in class Tensor<Tensor_U8>
      Parameters:
      coordinate - Coordinate of the element which is to be read
      Returns:
      Tensor elements's value as a double
    • getData

      public Object getData()
      Description copied from class: Tensor
      Returns internal array used to store tensor data. Data is stored in a row-major order in a single array.
      Specified by:
      getData in class Tensor<Tensor_U8>
      Returns:
      tensor data.
    • setData

      public void setData(Object data)
      Description copied from class: Tensor
      Used to change the internal array in an abstract way
      Specified by:
      setData in class Tensor<Tensor_U8>
    • innerArrayGrow

      protected void innerArrayGrow(int N)
      Description copied from class: Tensor
      Re-declare inner array so that it is at least of length N
      Specified by:
      innerArrayGrow in class Tensor<Tensor_U8>
      Parameters:
      N - Desired minimum length of inner array
    • innerArrayLength

      protected int innerArrayLength()
      Description copied from class: Tensor
      Length of inner array as returned by "data.length"
      Specified by:
      innerArrayLength in class Tensor<Tensor_U8>
      Returns:
      Length of inner array
    • create

      public Tensor_U8 create(int... shape)
      Description copied from class: Tensor
      Creates a tensor of the same type with the specified shape
      Specified by:
      create in class Tensor<Tensor_U8>
      Parameters:
      shape - Shape of the new tensor
      Returns:
      New tensor with the specified shape
    • zero

      public void zero()
      Description copied from class: Tensor
      Sets all elements in the tensor to the value of zero
      Specified by:
      zero in class Tensor<Tensor_U8>
    • getDataType

      public Class getDataType()
      Description copied from interface: ITensor
      Class of primitive data type used to store tensor
      Returns:
      Internal data type class.