(iterable)
Allows training with DataLoaders in a single infinite loop:
        for i, (x, y) in enumerate(inf_generator(train_loader)):
Allows training with DataLoaders in a single infinite loop:
        for i, (x, y) in enumerate(inf_generator(train_loader)):
Allows training with DataLoaders in a single infinite loop : for i ( x y ) in enumerate ( inf_generator ( train_loader )) :
def inf_generator(iterable):
    """Allows training with DataLoaders in a single infinite loop:
        for i, (x, y) in enumerate(inf_generator(train_loader)):
    """
    iterator = iterable.__iter__()
    while True:
        try:
            yield iterator.__next__()
        except StopIteration:
            iterator = iterable.__iter__()
def inf_generator ( iterable ) : iterator = iterable . __iter__ ( ) while True : try : yield iterator . __next__ ( ) except StopIteration : iterator = iterable . __iter__ ( )