diff --git a/baselines/common/misc_util.py b/baselines/common/misc_util.py index 6a296d4..48bc3de 100644 --- a/baselines/common/misc_util.py +++ b/baselines/common/misc_util.py @@ -13,27 +13,6 @@ def zipsame(*seqs): return zip(*seqs) -def unpack(seq, sizes): - """ - Unpack 'seq' into a sequence of lists, with lengths specified by 'sizes'. - None = just one bare element, not a list - - Example: - unpack([1,2,3,4,5,6], [3,None,2]) -> ([1,2,3], 4, [5,6]) - """ - seq = list(seq) - it = iter(seq) - assert sum(1 if s is None else s for s in sizes) == len(seq), "Trying to unpack %s into %s" % (seq, sizes) - for size in sizes: - if size is None: - yield it.__next__() - else: - li = [] - for _ in range(size): - li.append(it.__next__()) - yield li - - class EzPickle(object): """Objects that are pickled and unpickled via their constructor arguments.