()
| 229 | |
| 230 | |
| 231 | def main(): |
| 232 | parser = argparse.ArgumentParser( |
| 233 | description="load a network and run inference on random data", |
| 234 | formatter_class=argparse.ArgumentDefaultsHelpFormatter, |
| 235 | ) |
| 236 | parser.add_argument("net") |
| 237 | parser.add_argument( |
| 238 | "--device", "-d", help="set defult device, like 'gpux' or 'cpux'" |
| 239 | ) |
| 240 | parser.add_argument( |
| 241 | "--calc-output-rms", |
| 242 | action="store_true", |
| 243 | help="compute RMS of outputs; useful for comparing computing results", |
| 244 | ) |
| 245 | parser.add_argument( |
| 246 | "--output-name", |
| 247 | nargs="*", |
| 248 | help="Specify output name. This option can be" |
| 249 | " specified multiple times. We will look for opr/var" |
| 250 | " in the graph", |
| 251 | ) |
| 252 | parser.add_argument( |
| 253 | "--load-input-data", |
| 254 | help="load input data from pickle file; it should be" |
| 255 | " a numpy array or a dict of numpy array", |
| 256 | ) |
| 257 | parser.add_argument("--profile", help="profiler output file") |
| 258 | parser.add_argument( |
| 259 | "--fast-run", |
| 260 | action="store_true", |
| 261 | help="enable fast running by profiling conv algorithms during compiling.", |
| 262 | ) |
| 263 | parser.add_argument( |
| 264 | "--reproducible", action="store_true", help="use reproducible kernels" |
| 265 | ) |
| 266 | parser.add_argument( |
| 267 | "--input-desc", |
| 268 | help="specifiy input names and shapes manually in" |
| 269 | " format: <name>:<shape>[;<name>:<shape>, ...], where" |
| 270 | " name is a string and shape is a comma separated" |
| 271 | ' string. e.g., "data:128,1,28,28,label:128".' |
| 272 | " different input tensor are separated by semicolon.", |
| 273 | ) |
| 274 | parser.add_argument( |
| 275 | "--batchsize", |
| 276 | type=int, |
| 277 | help="change batchsize; the first dimension of each" |
| 278 | " input is assumed to be batch size", |
| 279 | ) |
| 280 | parser.add_argument( |
| 281 | "--warm-up", |
| 282 | type=int, |
| 283 | default=0, |
| 284 | help="times of warm up model before do timing " " for better estimation", |
| 285 | ) |
| 286 | parser.add_argument( |
| 287 | "--verbose", |
| 288 | "-v", |
no test coverage detected