TInt32

public interface TInt32

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
tensorOf(Shape shape)
Allocates a new tensor of the given shape.
abstract static TInt32
tensorOf(NdArray<Integer> src)
Allocates a new tensor which is a copy of a given array of ints.
abstract static TInt32
tensorOf(Shape shape, IntDataBuffer data)
Allocates a new tensor of the given shape, initialized with the provided data.
abstract static TInt32
tensorOf(Shape shape, Consumer<TInt32> dataInit)
Allocates a new tensor of the given shape and initialize its data.
abstract static TInt32
vectorOf(int... values)
Allocates a new tensor for storing a vector of ints.

Inherited Methods

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