DatasetOptional
Stay organized with collections
Save and categorize content based on your preferences.
An optional represents the result of a dataset getNext operation that may fail, when the end of
the dataset has been reached.
Inherited Methods
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
Public Constructors
public
DatasetOptional
(Ops tf, Operand<?> optionalVariant, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes)
Public Methods
public
Ops
getOpsInstance
()
public
Operand<?>
getOptionalVariant
()
public
List<Operand<?>>
getValue
()
Returns the value of the dataset element represented by this optional, if it exists.
Whether this optional has a value.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-11-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-11-29 UTC."],[],[],null,["# DatasetOptional\n\npublic class **DatasetOptional** \n\n|---|---|---|\n| Known Direct Subclasses [MapOptional](/jvm/api_docs/java/org/tensorflow/framework/data/impl/MapOptional) |----------------------------------------------------------------------------------|---| | [MapOptional](/jvm/api_docs/java/org/tensorflow/framework/data/impl/MapOptional) | | |||\n\nAn optional represents the result of a dataset getNext operation that may fail, when the end of\nthe dataset has been reached. \n\n### Public Constructors\n\n|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [DatasetOptional](/jvm/api_docs/java/org/tensorflow/framework/data/DatasetOptional#DatasetOptional(Ops, org.tensorflow.Operand\u003c?\u003e, java.util.List\u003cjava.lang.Class\u003c? extends org.tensorflow.types.family.TType\u003e\u003e, java.util.List\u003corg.tensorflow.ndarray.Shape\u003e))(Ops tf, [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c?\\\u003e optionalVariant, List\\\u003cClass\\\u003c? extends [TType](/jvm/api_docs/java/org/tensorflow/types/family/TType)\\\u003e\\\u003e outputTypes, List\\\u003c[Shape](/jvm/api_docs/java/org/tensorflow/ndarray/Shape)\\\u003e outputShapes) |\n\n### Public Methods\n\n|----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [DatasetOptional](/jvm/api_docs/java/org/tensorflow/framework/data/DatasetOptional) | [fromComponents](/jvm/api_docs/java/org/tensorflow/framework/data/DatasetOptional#fromComponents(Ops, java.util.List\u003corg.tensorflow.Operand\u003c?\u003e\u003e, java.util.List\u003cjava.lang.Class\u003c? extends org.tensorflow.types.family.TType\u003e\u003e, java.util.List\u003corg.tensorflow.ndarray.Shape\u003e))(Ops tf, List\\\u003c[Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c?\\\u003e\\\u003e components, List\\\u003cClass\\\u003c? extends [TType](/jvm/api_docs/java/org/tensorflow/types/family/TType)\\\u003e\\\u003e outputTypes, List\\\u003c[Shape](/jvm/api_docs/java/org/tensorflow/ndarray/Shape)\\\u003e outputShapes) |\n| Ops | [getOpsInstance](/jvm/api_docs/java/org/tensorflow/framework/data/DatasetOptional#getOpsInstance())() |\n| [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c?\\\u003e | [getOptionalVariant](/jvm/api_docs/java/org/tensorflow/framework/data/DatasetOptional#getOptionalVariant())() |\n| List\\\u003c[Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c?\\\u003e\\\u003e | [getValue](/jvm/api_docs/java/org/tensorflow/framework/data/DatasetOptional#getValue())() Returns the value of the dataset element represented by this optional, if it exists. |\n| [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c[TBool](/jvm/api_docs/java/org/tensorflow/types/TBool)\\\u003e | [hasValue](/jvm/api_docs/java/org/tensorflow/framework/data/DatasetOptional#hasValue())() Whether this optional has a value. |\n\n### Inherited Methods\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| boolean | equals(Object arg0) |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public\n**DatasetOptional**\n(Ops tf, [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c?\\\u003e optionalVariant, List\\\u003cClass\\\u003c? extends [TType](/jvm/api_docs/java/org/tensorflow/types/family/TType)\\\u003e\\\u003e outputTypes, List\\\u003c[Shape](/jvm/api_docs/java/org/tensorflow/ndarray/Shape)\\\u003e outputShapes)\n\n\u003cbr /\u003e\n\nPublic Methods\n--------------\n\n#### public static [DatasetOptional](/jvm/api_docs/java/org/tensorflow/framework/data/DatasetOptional)\n**fromComponents**\n(Ops tf, List\\\u003c[Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c?\\\u003e\\\u003e components, List\\\u003cClass\\\u003c? extends [TType](/jvm/api_docs/java/org/tensorflow/types/family/TType)\\\u003e\\\u003e outputTypes, List\\\u003c[Shape](/jvm/api_docs/java/org/tensorflow/ndarray/Shape)\\\u003e outputShapes)\n\n\u003cbr /\u003e\n\n#### public Ops\n**getOpsInstance**\n()\n\n\u003cbr /\u003e\n\n#### public [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c?\\\u003e\n**getOptionalVariant**\n()\n\n\u003cbr /\u003e\n\n#### public List\\\u003c[Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c?\\\u003e\\\u003e\n**getValue**\n()\n\nReturns the value of the dataset element represented by this optional, if it exists. \n\n#### public [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c[TBool](/jvm/api_docs/java/org/tensorflow/types/TBool)\\\u003e\n**hasValue**\n()\n\nWhether this optional has a value."]]