| 19 | created for it afterwards. |
| 20 | """ |
| 21 | def __init__(self, nets=None, record=None, should_stop=None): |
| 22 | builder_children = NetBuilder.current().get() |
| 23 | assert nets is None or len(builder_children) == 0, ( |
| 24 | 'Cannot both use `ops` syntax and return a list of nets.') |
| 25 | if nets is None: |
| 26 | nets = builder_children |
| 27 | if isinstance(nets, core.Net): |
| 28 | nets = [nets] |
| 29 | self.nets = [] if nets is None else list(nets) |
| 30 | self.record = None if record is None else as_record(record) |
| 31 | self.should_stop = should_stop |
| 32 | |
| 33 | |
| 34 | DEFAULT_QUEUE_CAPACITY = 100 |