public enum DataType extends Enum<DataType>
Tensor
as an enum.Enum Constant and Description |
---|
BOOL
Boolean.
|
DOUBLE
64-bit double precision floating point.
|
FLOAT
32-bit single precision floating point.
|
INT32
32-bit signed integer.
|
INT64
64-bit signed integer.
|
STRING
A sequence of bytes.
|
UINT8
8-bit unsigned integer.
|
Modifier and Type | Method and Description |
---|---|
int |
byteSize()
Returns the size of an element of this type, in bytes, or -1 if element size is variable.
|
static DataType |
fromClass(Class<?> c)
Returns the DataType of a Tensor whose elements have the type specified by class
c . |
static DataType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DataType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DataType FLOAT
public static final DataType DOUBLE
public static final DataType INT32
public static final DataType UINT8
public static final DataType STRING
TensorFlow uses the STRING type for an arbitrary sequence of bytes.
public static final DataType INT64
public static final DataType BOOL
public static DataType[] values()
for (DataType c : DataType.values()) System.out.println(c);
public static DataType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int byteSize()
public static DataType fromClass(Class<?> c)
c
.c
- The class describing the TensorFlow type of interest.DataType
enum corresponding to c
.IllegalArgumentException
- if objects of c
do not correspond to a TensorFlow
datatype.Copyright © 2022. All rights reserved.