Caffe source code Read (iii) caffe.cpp

Source: Internet
Author: User

From the main function, say:

1, the GFlags library is the main function set usage information is the repository of Google's open-source Processor command line. In a folder file that uses command-line parameters (source or head file), the definition of the variable is first used in the following definition. Define_int32, Define_int64, Define_bool, etc., the Language law: Define_int32 (Name,default_value, "description"). Then you can use the Flags_name variable, the value of which is the command line to pass the parameters, regardless of the value, in other code files if you want to use the command parameters, can be used Declare_int32 (name) (Name for int32 type, Other supported types can also be used)

2, the main function, the Getbrewfunction function, under the standard instruction, the main function will execute Getbrewfunction function.

In Caffe.cpp, some brewfunction functions are established and registered into the container g_brew_map by registerbrewfunction (function):

int device_query (): Used to query GPU information

int train (): Training neural network

int time (): Test model execution times

The Getbrewfunction function finds the corresponding function pointer in the G_BREW_MAP container and returns it through the Caffe command after the first argument.

Caffe source code Read (iii) caffe.cpp

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.