Skip to content

Commit a57f75f

Browse files
Alfonso CastañoThe TensorFlow Datasets Authors
authored andcommitted
Fix ambiguous if on arrays
PiperOrigin-RevId: 686050870
1 parent bc48d05 commit a57f75f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorflow_datasets/core/utils/conversion_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def to_tfds_value(value: Any, feature: feature_lib.FeatureConnector) -> Any:
152152
case _:
153153
return [value]
154154
case feature_lib.Audio():
155-
if array := value.get('array'):
155+
if (array := value.get('array')) is not None:
156156
# Hugging Face uses floats, TFDS uses integers.
157157
return [int(sample * feature.sample_rate) for sample in array]
158158
elif (path := value.get('path')) and (path := epath.Path(path)).exists():

0 commit comments

Comments
 (0)