ByteDenseNdArray

public class ByteDenseNdArray

Public Methods

ByteNdArray
copyTo(NdArray<Byte> dst)
static ByteNdArray
create(ByteDataBuffer buffer, Shape shape)
byte
getByte(long... indices)
Returns the byte value of the scalar found at the given coordinates.
ByteNdArray
ByteNdArray
setByte(byte value, long... indices)
Assigns the byte value of the scalar found at the given coordinates.
ByteNdArray

Inherited Methods

org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray
NdArraySequence<ByteNdArray>
elements(int dimensionIdx)
boolean
equals(Object obj)
ByteNdArray
get(long... coords)
Byte
getObject(long... coords)
int
ByteNdArray
read(DataBuffer<Byte> dst)
ByteNdArray
set(NdArray<Byte> src, long... coordinates)
ByteNdArray
setObject(Byte value, long... coords)
ByteNdArray
slice(long position, DimensionalSpace sliceDimensions)
ByteNdArray
slice(Index... indices)
ByteNdArray
write(DataBuffer<Byte> src)
org.tensorflow.ndarray.impl.AbstractNdArray
DimensionalSpace
boolean
equals(Object obj)
int
NdArraySequence<ByteNdArray>
scalars()
Returns a sequence of all scalars in this array.
Shape
shape()
abstract ByteNdArray
slice(long position, DimensionalSpace dimensions)
boolean
equals(Object arg0)
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
org.tensorflow.ndarray.NdArray
abstract NdArray<Byte>
copyTo(NdArray<Byte> dst)
Copy the content of this array to the destination array.
abstract NdArraySequence<? extends NdArray<T>>
elements(int dimensionIdx)
Returns a sequence of all elements at a given dimension.
abstract boolean
equals(Object obj)
Checks equality between n-dimensional arrays.
abstract NdArray<Byte>
get(long... coordinates)
Returns the N-dimensional element of this array at the given coordinates.
abstract Byte
getObject(long... coordinates)
Returns the value of the scalar found at the given coordinates.
abstract NdArray<Byte>
read(DataBuffer<Byte> dst)
Read the content of this N-dimensional array into the destination buffer.
abstract NdArraySequence<? extends NdArray<T>>
scalars()
Returns a sequence of all scalars in this array.
abstract NdArray<Byte>
set(NdArray<Byte> src, long... coordinates)
Assigns the value of the N-dimensional element found at the given coordinates.
abstract NdArray<Byte>
setObject(Byte value, long... coordinates)
Assigns the value of the scalar found at the given coordinates.
abstract NdArray<Byte>
slice(Index... indices)
Creates a multi-dimensional view (or slice) of this array by mapping one or more dimensions to the given index selectors.
abstract NdArray<Byte>
write(DataBuffer<Byte> src)
Write the content of this N-dimensional array from the source buffer.
org.tensorflow.ndarray.ByteNdArray
abstract ByteNdArray
copyTo(NdArray<Byte> dst)
abstract NdArraySequence<ByteNdArray>
elements(int dimensionIdx)
Returns a sequence of all elements at a given dimension.
abstract ByteNdArray
get(long... coordinates)
Returns the N-dimensional element of this array at the given coordinates.
abstract byte
getByte(long... coordinates)
Returns the byte value of the scalar found at the given coordinates.
abstract Byte
getObject(long... coordinates)
Returns the value of the scalar found at the given coordinates.
abstract ByteNdArray
read(DataBuffer<Byte> dst)
abstract ByteNdArray
abstract NdArraySequence<ByteNdArray>
scalars()
Returns a sequence of all scalars in this array.
abstract ByteNdArray
set(NdArray<Byte> src, long... coordinates)
abstract ByteNdArray
setByte(byte value, long... coordinates)
Assigns the byte value of the scalar found at the given coordinates.
abstract ByteNdArray
setObject(Byte value, long... coordinates)
abstract ByteNdArray
slice(Index... indices)
Creates a multi-dimensional view (or slice) of this array by mapping one or more dimensions to the given index selectors.
abstract ByteNdArray
abstract ByteNdArray
write(DataBuffer<Byte> src)
org.tensorflow.ndarray.Shaped
abstract int
rank()
abstract Shape
shape()
abstract long
size()
Computes and returns the total size of this container, in number of values.
org.tensorflow.ndarray.NdArray
abstract NdArray<Byte>
copyTo(NdArray<Byte> dst)
Copy the content of this array to the destination array.
abstract NdArraySequence<? extends NdArray<T>>
elements(int dimensionIdx)
Returns a sequence of all elements at a given dimension.
abstract boolean
equals(Object obj)
Checks equality between n-dimensional arrays.
abstract NdArray<Byte>
get(long... coordinates)
Returns the N-dimensional element of this array at the given coordinates.
abstract Byte
getObject(long... coordinates)
Returns the value of the scalar found at the given coordinates.
abstract NdArray<Byte>
read(DataBuffer<Byte> dst)
Read the content of this N-dimensional array into the destination buffer.
abstract NdArraySequence<? extends NdArray<T>>
scalars()
Returns a sequence of all scalars in this array.
abstract NdArray<Byte>
set(NdArray<Byte> src, long... coordinates)
Assigns the value of the N-dimensional element found at the given coordinates.
abstract NdArray<Byte>
setObject(Byte value, long... coordinates)
Assigns the value of the scalar found at the given coordinates.
abstract NdArray<Byte>
slice(Index... indices)
Creates a multi-dimensional view (or slice) of this array by mapping one or more dimensions to the given index selectors.
abstract NdArray<Byte>
write(DataBuffer<Byte> src)
Write the content of this N-dimensional array from the source buffer.

Public Methods

public ByteNdArray copyTo (NdArray<Byte> dst)

public static ByteNdArray create (ByteDataBuffer buffer, Shape shape)

public byte getByte (long... indices)

Returns the byte value of the scalar found at the given coordinates.

To access the scalar element, the number of coordinates provided must be equal to the number of dimensions of this array (i.e. its rank). For example:

ByteNdArray matrix = NdArrays.ofBytes(shape(2, 2));  // matrix rank = 2
  matrix.getByte(0, 1);  // succeeds, returns 0
  matrix.getByte(0);  // throws IllegalRankException

  ByteNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
  scalar.getByte();  // succeeds, returns 0
 

Parameters
indices coordinates of the scalar to resolve
Returns
  • value of that scalar

public ByteNdArray read (ByteDataBuffer dst)

public ByteNdArray setByte (byte value, long... indices)

Assigns the byte value of the scalar found at the given coordinates.

To access the scalar element, the number of coordinates provided must be equal to the number of dimensions of this array (i.e. its rank). For example:

ByteNdArray matrix = NdArrays.ofBytes(shape(2, 2));  // matrix rank = 2
  matrix.setByte(10, 0, 1);  // succeeds
  matrix.setByte(10, 0);  // throws IllegalRankException

  ByteNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
  scalar.setByte(10);  // succeeds
 

Parameters
value the value to assign
indices coordinates of the scalar to assign
Returns
  • this array

public ByteNdArray write (ByteDataBuffer src)