torch/csrc/jit/passes/loop_unrolling.cpp
// Counts the size of this block, stopping and returning once reaches limit instructions.
Counts the size of this block, stopping and returning once reaches limit instructions.
Counts the size of this block stopping and returning once reaches limit instructions .
int64_t limitedBlockSize(Block *body, int64_t limit) {
  auto it = body->nodes().begin();
  auto end = body->nodes().end();
  for (int64_t i = 0; i < limit; ++i, ++it) {
    for (Block *subblock : it->blocks()) {
      i += limitedBlockSize(subblock, limit - i);
    }
    if (it == end) {
      return i;
    }
  }
  return limit;
}
int64_t limitedBlockSize ( Block * body , int64_t limit ) { auto it = body -> nodes ( ) . begin ( ) ; auto end = body -> nodes ( ) . end ( ) ; for ( int64_t i = 0 ; i < limit ; ++ i , ++ it ) { for ( Block * subblock : it -> blocks ( ) ) { i += limitedBlockSize ( subblock , limit - i ) ; } if ( it == end ) { return i ; } } return limit ; }
Counts the size of this block, stopping and returning once reaches limit instructions.
Counts the size of this block stopping and returning once reaches limit instructions .