| 422 | RegisterBrewFunction(time); |
| 423 | |
| 424 | int main(int argc, char** argv) { |
| 425 | // Print output to stderr (while still logging). |
| 426 | FLAGS_alsologtostderr = 1; |
| 427 | // Set version |
| 428 | gflags::SetVersionString(AS_STRING(CAFFE_VERSION)); |
| 429 | // Usage message. |
| 430 | gflags::SetUsageMessage("command line brew\n" |
| 431 | "usage: caffe <command> <args>\n\n" |
| 432 | "commands:\n" |
| 433 | " train train or finetune a model\n" |
| 434 | " test score a model\n" |
| 435 | " device_query show GPU diagnostic information\n" |
| 436 | " time benchmark model execution time"); |
| 437 | // Run tool or show usage. |
| 438 | caffe::GlobalInit(&argc, &argv); |
| 439 | if (argc == 2) { |
| 440 | #ifdef WITH_PYTHON_LAYER |
| 441 | try { |
| 442 | #endif |
| 443 | return GetBrewFunction(caffe::string(argv[1]))(); |
| 444 | #ifdef WITH_PYTHON_LAYER |
| 445 | } catch (bp::error_already_set) { |
| 446 | PyErr_Print(); |
| 447 | return 1; |
| 448 | } |
| 449 | #endif |
| 450 | } else { |
| 451 | gflags::ShowUsageWithFlagsRestrict(argv[0], "tools/caffe"); |
| 452 | } |
| 453 | } |
nothing calls this directly
no test coverage detected