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