FloatDenseNdArray

public class FloatDenseNdArray

Public Methods

FloatDataBuffer
buffer()
FloatNdArray
copyTo(NdArray<Float> dst)
static FloatNdArray
create(FloatDataBuffer buffer, Shape shape)
float
getFloat(long... indices)
Returns the float value of the scalar found at the given coordinates.
FloatNdArray
FloatNdArray
setFloat(float value, long... indices)
Assigns the float value of the scalar found at the given coordinates.
FloatNdArray

Inherited Methods

org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray
NdArraySequence<FloatNdArray>
elements(int dimensionIdx)
boolean
equals(Object obj)
FloatNdArray
get(long... coords)
Float
getObject(long... coords)
int
FloatNdArray
read(DataBuffer<Float> dst)
FloatNdArray
set(NdArray<Float> src, long... coordinates)
FloatNdArray
setObject(Float value, long... coords)
FloatNdArray
slice(long position, DimensionalSpace sliceDimensions)
FloatNdArray
slice(Index... indices)
FloatNdArray
write(DataBuffer<Float> src)
org.tensorflow.ndarray.impl.AbstractNdArray
DimensionalSpace
boolean
equals(Object obj)
int
NdArraySequence<FloatNdArray>
scalars()
Returns a sequence of all scalars in this array.
Shape
shape()
abstract FloatNdArray
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<Float>
copyTo(NdArray<Float> 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<Float>
get(long... coordinates)
Returns the N-dimensional element of this array at the given coordinates.
abstract Float
getObject(long... coordinates)
Returns the value of the scalar found at the given coordinates.
abstract NdArray<Float>
read(DataBuffer<Float> 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<Float>
set(NdArray<Float> src, long... coordinates)
Assigns the value of the N-dimensional element found at the given coordinates.
abstract NdArray<Float>
setObject(Float value, long... coordinates)
Assigns the value of the scalar found at the given coordinates.
abstract NdArray<Float>
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<Float>
write(DataBuffer<Float> src)
Write the content of this N-dimensional array from the source buffer.
org.tensorflow.ndarray.FloatNdArray
abstract FloatNdArray
copyTo(NdArray<Float> dst)
abstract NdArraySequence<FloatNdArray>
elements(int dimensionIdx)
Returns a sequence of all elements at a given dimension.
abstract FloatNdArray
get(long... coordinates)
Returns the N-dimensional element of this array at the given coordinates.
abstract float
getFloat(long... coordinates)
Returns the float value of the scalar found at the given coordinates.
abstract Float
getObject(long... coordinates)
Returns the value of the scalar found at the given coordinates.
abstract FloatNdArray
abstract FloatNdArray
read(DataBuffer<Float> dst)
abstract NdArraySequence<FloatNdArray>
scalars()
Returns a sequence of all scalars in this array.
abstract FloatNdArray
set(NdArray<Float> src, long... coordinates)
abstract FloatNdArray
setFloat(float value, long... coordinates)
Assigns the float value of the scalar found at the given coordinates.
abstract FloatNdArray
setObject(Float value, long... coordinates)
abstract FloatNdArray
slice(Index... coordinates)
Creates a multi-dimensional view (or slice) of this array by mapping one or more dimensions to the given index selectors.
abstract FloatNdArray
write(DataBuffer<Float> src)
abstract FloatNdArray
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<Float>
copyTo(NdArray<Float> 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<Float>
get(long... coordinates)
Returns the N-dimensional element of this array at the given coordinates.
abstract Float
getObject(long... coordinates)
Returns the value of the scalar found at the given coordinates.
abstract NdArray<Float>
read(DataBuffer<Float> 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<Float>
set(NdArray<Float> src, long... coordinates)
Assigns the value of the N-dimensional element found at the given coordinates.
abstract NdArray<Float>
setObject(Float value, long... coordinates)
Assigns the value of the scalar found at the given coordinates.
abstract NdArray<Float>
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<Float>
write(DataBuffer<Float> src)
Write the content of this N-dimensional array from the source buffer.

Public Methods

public FloatDataBuffer buffer ()

public FloatNdArray copyTo (NdArray<Float> dst)

public static FloatNdArray create (FloatDataBuffer buffer, Shape shape)

public float getFloat (long... indices)

Returns the float 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:

FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2));  // matrix rank = 2
  matrix.getFloat(0, 1);  // succeeds, returns 0.0f
  matrix.getFloat(0);  // throws IllegalRankException

  FloatNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
  scalar.getFloat();  // succeeds, returns 0.0f
 

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

public FloatNdArray read (FloatDataBuffer dst)

public FloatNdArray setFloat (float value, long... indices)

Assigns the float 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:

FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2));  // matrix rank = 2
  matrix.setFloat(10.0f, 0, 1);  // succeeds
  matrix.setFloat(10.0f, 0);  // throws IllegalRankException

  FloatNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
  scalar.setFloat(10.0f);  // succeeds
 

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

public FloatNdArray write (FloatDataBuffer src)