()
return args
Parse commandline.
Parse commandline.
Parse commandline .
def get_args():
    """Parse commandline."""
    parser = argparse.ArgumentParser()
    parser.add_argument("--input", required=True,
                        help="Input model file(*.mdl, should be text format).")
    parser.add_argument("--output",
                        help="Output onnx model file(*.onnx)."
                             "Using input model file's name as default.")
    parser.add_argument("--configure", dest='conf',
                        help="Path to save configure file(*.conf)."
                             "Using output model file's name as default.")
    parser.add_argument("--trans-model", dest='trans_path',
                        help="Output transition model file(*.trans)."
                             "Using output model file's name as default.")
    parser.add_argument('--chunk-size', type=int, dest='chunk_size',
                        help='chunk size, default is 20',
                        default=DefaultChunkSize)
    parser.add_argument('--batch', type=int, dest='batch',
                        help='batch size, default is 1', default=DefaultBatch)
    parser.add_argument('--nnet-type', type=int,
                        dest='nnet_type', help='nnet type: 2 or 3',
                        default=NNet3)
    parser.add_argument('--fuse-lstm', type=str2bool,
                        dest='fuse_lstm',
                        help='fuse lstm four parts to dynamic lstm or not,'
                             ' default is true',
                        default=True)
    parser.add_argument('--fuse-stats', type=str2bool,
                        dest='fuse_stats',
                        help='fuse StatisticsExtraction/StatisticsPooling'
                             ' or not, default is true',
                        default=True)
    parser.add_argument('--left-context', required=True, type=int,
                        dest='left_context',
                        help='Add Left Context')

    parser.add_argument('--right-context', required=True, type=int,
                        dest='right_context',
                        help='Add RightContext')

    parser.add_argument('--modulus', type=int,
                        dest='modulus',
                        help='Modulus of the model.', default=1)

    parser.add_argument('--subsample-factor', type=int,
                        dest='subsample_factor',
                        help='Add Subsample factor, default is 1.', default=1)

    args = parser.parse_args()
    return args
def get_args ( ) : parser = argparse . ArgumentParser ( ) parser . add_argument ( "--input" , required = True , help = "Input model file(*.mdl, should be text format)." ) parser . add_argument ( "--output" , help = "Output onnx model file(*.onnx)." "Using input model file's name as default." ) parser . add_argument ( "--configure" , dest = 'conf' , help = "Path to save configure file(*.conf)." "Using output model file's name as default." ) parser . add_argument ( "--trans-model" , dest = 'trans_path' , help = "Output transition model file(*.trans)." "Using output model file's name as default." ) parser . add_argument ( '--chunk-size' , type = int , dest = 'chunk_size' , help = 'chunk size, default is 20' , default = DefaultChunkSize ) parser . add_argument ( '--batch' , type = int , dest = 'batch' , help = 'batch size, default is 1' , default = DefaultBatch ) parser . add_argument ( '--nnet-type' , type = int , dest = 'nnet_type' , help = 'nnet type: 2 or 3' , default = NNet3 ) parser . add_argument ( '--fuse-lstm' , type = str2bool , dest = 'fuse_lstm' , help = 'fuse lstm four parts to dynamic lstm or not,' ' default is true' , default = True ) parser . add_argument ( '--fuse-stats' , type = str2bool , dest = 'fuse_stats' , help = 'fuse StatisticsExtraction/StatisticsPooling' ' or not, default is true' , default = True ) parser . add_argument ( '--left-context' , required = True , type = int , dest = 'left_context' , help = 'Add Left Context' ) parser . add_argument ( '--right-context' , required = True , type = int , dest = 'right_context' , help = 'Add RightContext' ) parser . add_argument ( '--modulus' , type = int , dest = 'modulus' , help = 'Modulus of the model.' , default = 1 ) parser . add_argument ( '--subsample-factor' , type = int , dest = 'subsample_factor' , help = 'Add Subsample factor, default is 1.' , default = 1 ) args = parser . parse_args ( ) return args