File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
tensorflow_datasets/core/features Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ def __init__(
41
41
encoder_config = None ,
42
42
* ,
43
43
doc : feature_lib .DocArg = None ,
44
+ optional : bool = False ,
44
45
):
45
46
"""Constructs a Text FeatureConnector.
46
47
@@ -50,6 +51,7 @@ def __init__(
50
51
encoder_config: `tfds.deprecated.text.TextEncoderConfig`, needed if
51
52
restoring from a file with `load_metadata`.
52
53
doc: Documentation of this feature (e.g. description).
54
+ optional: Whether the feature is optional.
53
55
"""
54
56
if encoder and encoder_config :
55
57
raise ValueError ("If encoder is provided, encoder_config must be None." )
@@ -75,6 +77,7 @@ def __init__(
75
77
shape = (None ,) if has_encoder else (),
76
78
dtype = np .int64 if has_encoder else np .object_ ,
77
79
doc = doc ,
80
+ optional = optional ,
78
81
)
79
82
80
83
@property
You can’t perform that action at this time.
0 commit comments