Added maxabort argument in OptimizeNetwork function