()
Main func.
Main func.
Main func .
def main():
    """ Main func.
    """
    args = docopt(__doc__)


    # Check pytorch version
    assert(torch.__version__ >= "1.0.0"), "Please update your installation of PyTorch. You have {} and you should have version 1.0.0".format(torch.__version__)

    # seed the random number generators
    seed = int(args['--seed'])
    torch.manual_seed(seed)
    if args['--cuda']:
        torch.cuda.manual_seed(seed)
    np.random.seed(seed * 13 // 7)

    if args['train']:
        train(args)
    elif args['decode']:
        decode(args)
    else:
        raise RuntimeError('invalid run mode')
def main ( ) : args = docopt ( __doc__ ) # Check pytorch version assert ( torch . __version__ >= "1.0.0" ) , "Please update your installation of PyTorch. You have {} and you should have version 1.0.0" . format ( torch . __version__ ) # seed the random number generators seed = int ( args [ '--seed' ] ) torch . manual_seed ( seed ) if args [ '--cuda' ] : torch . cuda . manual_seed ( seed ) np . random . seed ( seed * 13 // 7 ) if args [ 'train' ] : train ( args ) elif args [ 'decode' ] : decode ( args ) else : raise RuntimeError ( 'invalid run mode' )