Skip to content

Commit fb880d8

Browse files
tomvdwThe TensorFlow Datasets Authors
authored andcommitted
Add a method to add a writer to a MultiOutputExampleWriter.
PiperOrigin-RevId: 648454945
1 parent 5dee51e commit fb880d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tensorflow_datasets/core/writer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ class MultiOutputExampleWriter(ExampleWriter):
194194
"""Example writer that can write multiple outputs."""
195195

196196
def __init__(self, writers: Sequence[ExampleWriter]): # pylint: disable=super-init-not-called
197-
self._writers = writers
197+
self._writers: list[ExampleWriter] = list(writers)
198+
199+
def add_writer(self, writer: ExampleWriter):
200+
self._writers.append(writer)
198201

199202
def write(
200203
self,

0 commit comments

Comments
 (0)