org.tensorflow.types

Defines classes that represent TensorFlow tensor types. For each possible data type that can be used in a tensor, there is a corresponding interface that is used to represent it and its hidden implementation. For example, the TensorFlow int32 type is represented by the tensor type interface TInt32 , where the T prefix stands for "Tensor of".

To support compile-time checking of tensor element types, each interface in this package must be bound to one of the marker interface found in org.tensorflow.types.family , according to the nature of the data.

Each tensor type must be annotated with TensorType to provide type metadata that should be used for allocating or mapping tensors of this type.

Instances of tensor types must also implement the NdArray interface so a user can access directly the tensor data in a n-dimensional space.

Note that while it is always possible to allocate a tensor using the Tensor.of(...) method, most tensor types expose factory methods that simplify the creation process, like scalarOf(...) , vectorOf(...) , tensorOf(...) , etc.

Interfaces

TBfloat16 Brain 16-bit float tensor type.
TBool Boolean tensor type.
TFloat16 IEEE-754 half-precision 16-bit float tensor type.
TFloat32 IEEE-754 single-precision 32-bit float tensor type.
TFloat64 IEEE-754 double-precision 64-bit float tensor type.
TInt32 32-bit signed integer tensor type.
TInt64 64-bit signed integer tensor type.
TString String type.
TUint8 8-bit unsigned integer tensor type.