Class DatasetOptional
java.lang.Object
org.tensorflow.framework.data.DatasetOptional
An optional represents the result of a dataset getNext operation that may fail, when the end of
the dataset has been reached.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDatasetOptional(DatasetOptional other) Creates a Dataset that is a copy of another DatasetDatasetOptional(Ops tf, Operand<?> optionalVariant, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes) Creates a DatasetOptional dataset -
Method Summary
Modifier and TypeMethodDescriptionstatic DatasetOptionalfromComponents(Ops tf, List<Operand<?>> components, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes) Creates a DatasetOptional from components.Gets the TensorFlow Ops instance for this datasetOperand<?> Gets the optional variant for this DatasetgetValue()Returns the value of the dataset element represented by this optional, if it exists.hasValue()Gets the indicator of whether this optional has a value.
-
Field Details
-
tf
-
-
Constructor Details
-
DatasetOptional
public DatasetOptional(Ops tf, Operand<?> optionalVariant, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes) Creates a DatasetOptional dataset- Parameters:
tf- the TensorFlow OpsoptionalVariant- the tensor that represents the dataset.outputTypes- a list of output types produced by this data set.outputShapes- a list of output shapes produced by this data set.
-
DatasetOptional
Creates a Dataset that is a copy of another Dataset- Parameters:
other- the other Dataset
-
-
Method Details
-
getOptionalVariant
Gets the optional variant for this Dataset- Returns:
- the optional variant for this Dataset
-
hasValue
-
getValue
-
fromComponents
public static DatasetOptional fromComponents(Ops tf, List<Operand<?>> components, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes) Creates a DatasetOptional from components.- Parameters:
tf- the TensorFlow Opscomponents- the components that constitute the DatasetOptionaloutputTypes- a list of output types produced by this data set.outputShapes- a list of output shapes produced by this data set.- Returns:
- a a DatasetOptional
-
getOpsInstance
Gets the TensorFlow Ops instance for this dataset- Returns:
- the TensorFlow Ops instance for this dataset
-