TNumber

public interface TNumber
Known Indirect Subclasses

Common interface for all numeric tensors.

Operations that only accepts numeric values as some of their operands enforce that the tensor types for these operands to be bound to this interface. For example:

Ops tf = Ops.create();

 Constant<TFloat32> c1 = tf.array(1.0f, 2.0f, 3.0f);
 Constant<TFloat32> c2 = tf.array(true, false, true);

 tf.nn.softmax(c1);  // OK
 tf.nn.softmax(c2);  // Compilation failure
 

Inherited Methods

org.tensorflow.types.family.TType
abstract void
close()
Release resources associated with the Tensor.
abstract DataType
dataType()
Returns the DataType of elements stored in the tensor.
abstract long
numBytes()
Returns the size, in bytes, of the tensor data.
abstract Class<? extends TType>
type()
Returns the type of this tensor as a registered subclass of TType
org.tensorflow.Tensor
abstract RawTensor
asRawTensor()
Returns a raw (untyped) representation of this tensor
abstract void
close()
Release resources associated with the Tensor.
abstract DataType
dataType()
Returns the DataType of elements stored in the tensor.
abstract long
numBytes()
Returns the size, in bytes, of the tensor data.
abstract static <T extends TType> T
of(Class<T> type, Shape shape, long size, Consumer<T> dataInitializer)
Allocates a tensor of a given datatype, shape and size.
abstract static <T extends TType> T
of(Class<T> type, Shape shape)
Allocates a tensor of a given datatype and shape.
abstract static <T extends TType> T
of(Class<T> type, Shape shape, long size)
Allocates a tensor of a given datatype, shape and size.
abstract static <T extends TType> T
of(Class<T> type, Shape shape, Consumer<T> dataInitializer)
Allocates and initialize a tensor of a given datatype and shape.
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.
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.
abstract void
close()