MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / ConcatData

Class ConcatData

tensorpack/dataflow/common.py:496–519  ·  view source on GitHub ↗

Concatenate several DataFlow. Produce datapoints from each DataFlow and start the next when one DataFlow is exhausted.

Source from the content-addressed store, hash-verified

494
495
496class ConcatData(DataFlow):
497 """
498 Concatenate several DataFlow.
499 Produce datapoints from each DataFlow and start the next when one
500 DataFlow is exhausted.
501 """
502
503 def __init__(self, df_lists):
504 """
505 Args:
506 df_lists (list): a list of DataFlow.
507 """
508 self.df_lists = df_lists
509
510 def reset_state(self):
511 for d in self.df_lists:
512 d.reset_state()
513
514 def __len__(self):
515 return sum(len(x) for x in self.df_lists)
516
517 def __iter__(self):
518 for d in self.df_lists:
519 yield from d
520
521
522class JoinData(DataFlow):

Callers 2

get_dataFunction · 0.85
get_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…