Skip to content

Instantly share code, notes, and snippets.

Bruce Halfish

Block or report user

Report or block Halfish

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Halfish /
Last active Aug 6, 2018
import argparse
# this file shows how to use argparse
# step 1,默认构造器
parser = argparse.ArgumentParser()
# step 2, 必须输入的参数,只能在1,2,4中选一个
parser.add_argument("level", type=int, choices=[1, 2, 4], help="which level to print.")
Halfish / cmdline.lua
Last active Aug 6, 2018
View cmdline.lua
-- create a CmdLine object
cmd = torch.CmdLine()
-- print help text
-- define input varians and default value
cmd:option('-threads', 2, 'number of threads to use')
cmd:option('-save', 'model.t7', 'name of model to save')
You can’t perform that action at this time.