Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ppwwyyxx committed Mar 17, 2020
1 parent bc5b5cc commit 22582cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tensorpack/dataflow/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def __iter__(self):
else:
yield from self._gen()

def __len__(self):
return len(self._gen)


class DataFromIterable(DataFlow):
""" Wrap an iterable of datapoints to a DataFlow"""
Expand Down
2 changes: 1 addition & 1 deletion tensorpack/tfutils/sessinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def _run_init(self, sess):
i._run_init(sess)


def SmartInit(obj, ignore_mismatch=False):
def SmartInit(obj, *, ignore_mismatch=False):
"""
Create a :class:`SessionInit` to be loaded to a session,
automatically from any supported objects, with some smart heuristics.
Expand Down

0 comments on commit 22582cc

Please sign in to comment.