32-bit signed integer tensor type.
Public Methods
abstract static TInt32 |
scalarOf(int value)
Allocates a new tensor for storing a single int value.
|
abstract static TInt32 | |
abstract static TInt32 | |
abstract static TInt32 |
tensorOf(Shape shape, IntDataBuffer data)
Allocates a new tensor of the given shape, initialized with the provided data.
|
abstract static TInt32 | |
abstract static TInt32 |
vectorOf(int... values)
Allocates a new tensor for storing a vector of ints.
|
Inherited Methods
abstract IntNdArray | |
abstract NdArraySequence<IntNdArray> |
elements(int dimensionIdx)
Returns a sequence of all elements at a given dimension.
|
abstract IntNdArray |
get(long... coordinates)
Returns the N-dimensional element of this array at the given coordinates.
|
abstract int |
getInt(long... coordinates)
Returns the integer value of the scalar found at the given coordinates.
|
abstract Integer |
getObject(long... coordinates)
Returns the value of the scalar found at the given coordinates.
|
abstract IntNdArray |
read(IntDataBuffer dst)
|
abstract IntNdArray |
read(DataBuffer<Integer> dst)
|
abstract NdArraySequence<IntNdArray> |
scalars()
Returns a sequence of all scalars in this array.
|
abstract IntNdArray | |
abstract IntNdArray |
setInt(int value, long... coordinates)
Assigns the integer value of the scalar found at the given coordinates.
|
abstract IntNdArray |
setObject(Integer value, long... coordinates)
|
abstract IntNdArray | |
abstract IntNdArray |
write(DataBuffer<Integer> src)
|
abstract IntNdArray |
write(IntDataBuffer src)
|
abstract NdArray<Integer> | |
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<Integer> |
get(long... coordinates)
Returns the N-dimensional element of this array at the given coordinates.
|
abstract Integer |
getObject(long... coordinates)
Returns the value of the scalar found at the given coordinates.
|
abstract NdArray<Integer> |
read(DataBuffer<Integer> 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<Integer> | |
abstract NdArray<Integer> |
setObject(Integer value, long... coordinates)
Assigns the value of the scalar found at the given coordinates.
|
abstract NdArray<Integer> | |
abstract NdArray<Integer> |
write(DataBuffer<Integer> src)
Write the content of this N-dimensional array from the source buffer.
|
abstract RawTensor |
asRawTensor()
Returns a raw (untyped) representation of this tensor
|
abstract void |
close()
Release resources associated with the Tensor.
|
abstract DataType | |
abstract long |
numBytes()
Returns the size, in bytes, of the tensor data.
|
abstract static <T extends TType> T | |
abstract static <T extends TType> T | |
abstract static <T extends TType> T | |
abstract static <T extends TType> T | |
abstract static <T extends TType> T |
of(Class<T> type, Shape shape, ByteDataBuffer rawData)
Creates a Tensor of any type from the raw data provided by the given buffer.
|
abstract Shape |
shape()
Returns the shape of the tensor.
|
abstract void |
close()
|
Public Methods
public static abstract TInt32 scalarOf (int value)
Allocates a new tensor for storing a single int value.
Parameters
value | int to store in the new tensor |
---|
Returns
- the new tensor
public static abstract TInt32 tensorOf (Shape shape)
Allocates a new tensor of the given shape.
Parameters
shape | shape of the tensor to allocate |
---|
Returns
- the new tensor
public static abstract TInt32 tensorOf (NdArray<Integer> src)
Allocates a new tensor which is a copy of a given array of ints.
The tensor will have the same shape as the source array and its data will be copied.
Parameters
src | the source array giving the shape and data to the new tensor |
---|
Returns
- the new tensor
public static abstract TInt32 tensorOf (Shape shape, IntDataBuffer data)
Allocates a new tensor of the given shape, initialized with the provided data.
Parameters
shape | shape of the tensor to allocate |
---|---|
data | buffer of ints to initialize the tensor with |
Returns
- the new tensor
public static abstract TInt32 tensorOf (Shape shape, Consumer<TInt32> dataInit)
Allocates a new tensor of the given shape and initialize its data.
Parameters
shape | shape of the tensor to allocate |
---|---|
dataInit | tensor data initializer |
Returns
- the new tensor
public static abstract TInt32 vectorOf (int... values)
Allocates a new tensor for storing a vector of ints.
Parameters
values | ints to store in the new tensor |
---|
Returns
- the new tensor
Throws
IllegalArgumentException | if no values are provided |
---|