Class FloatDenseNdArray
java.lang.Object
org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray<Float, FloatNdArray>
org.tensorflow.ndarray.impl.dense.FloatDenseNdArray
- All Implemented Interfaces:
FloatNdArray, NdArray<Float>, Shaped
public class FloatDenseNdArray
extends AbstractDenseNdArray<Float, FloatNdArray>
implements FloatNdArray
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuffer()copyFrom(FloatDataBuffer src) copyTo(FloatDataBuffer dst) Copy the content of this array to the destination array.static FloatNdArraycreate(FloatDataBuffer buffer, Shape shape) floatgetFloat(long... indices) Returns the float value of the scalar found at the given coordinates.scalars()Returns a sequence of all scalars in this array.setFloat(float value, long... indices) Assigns the float value of the scalar found at the given coordinates.shape()protected booleanslowEquals(NdArray<?> array) protected intMethods inherited from class AbstractDenseNdArray
copyFrom, copyTo, elements, equals, get, getObject, hashCode, set, setObject, slice, slice, slowCopyTo, toString, withShapeMethods inherited from interface FloatNdArray
copyFrom, copyTo, elements, get, getObject, scalars, set, setObject, slice, withShapeMethods inherited from interface NdArray
equals, streamOfObjects
-
Field Details
-
dimensions
-
-
Constructor Details
-
FloatDenseNdArray
-
-
Method Details
-
create
-
getFloat
public float getFloat(long... indices) Description copied from interface:FloatNdArrayReturns 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- Specified by:
getFloatin interfaceFloatNdArray- Parameters:
indices- coordinates of the scalar to resolve- Returns:
- value of that scalar
-
setFloat
Description copied from interface:FloatNdArrayAssigns 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- Specified by:
setFloatin interfaceFloatNdArray- Parameters:
value- value to assignindices- coordinates of the scalar to assign- Returns:
- this array
-
copyTo
Description copied from interface:NdArrayCopy the content of this array to the destination array.The
Shaped.shape()of the destination array must be equal to the shape of this array, or an exception is thrown. After the copy, the content of both arrays can be altered independently, without affecting each other.- Specified by:
copyToin interfaceFloatNdArray- Specified by:
copyToin interfaceNdArray<Float>- Parameters:
dst- array to receive a copy of the content of this array- Returns:
- this array
-
copyTo
- Specified by:
copyToin interfaceFloatNdArray
-
copyFrom
- Specified by:
copyFromin interfaceFloatNdArray
-
buffer
- Specified by:
bufferin classAbstractDenseNdArray<Float, FloatNdArray>
-
dimensions
-
shape
-
scalars
Description copied from interface:NdArrayReturns a sequence of all scalars in this array.This is equivalent to call
elements(shape().numDimensions() - 1) -
slowHashCode
protected int slowHashCode() -
slowEquals
-