Function that extract all the parameter from Caffe Layer, put it in a XLayer and Register it to XGraph TODO : @ARK : Use switch-case to get rid of long if-else-if chain
| 906 | // put it in a XLayer and Register it to XGraph |
| 907 | // TODO : @ARK : Use switch-case to get rid of long if-else-if chain |
| 908 | void ExtractParameters(const caffe::LayerParameter& src, XGraph& graph) |
| 909 | { |
| 910 | mapStrStr::const_iterator map_it = CaffeLayerMap.find(src.type()); |
| 911 | bool user_defined_layer = src.user_defined_layer(); |
| 912 | |
| 913 | if (user_defined_layer) |
| 914 | { |
| 915 | ExtractXCustomParameters(src, graph); |
| 916 | } |
| 917 | else if (map_it->second == "Convolution") |
| 918 | { |
| 919 | ExtractConvolutionParameters(src, graph); |
| 920 | } |
| 921 | else if (map_it->second == "Dropout") |
| 922 | { |
| 923 | ExtractDropoutParameters(src, graph); |
| 924 | } |
| 925 | else if (map_it->second == "Pooling") |
| 926 | { |
| 927 | ExtractPoolingParameters(src, graph); |
| 928 | } |
| 929 | else if (map_it->second == "ReLU") |
| 930 | { |
| 931 | ExtractReLUParameters(src, graph); |
| 932 | } |
| 933 | else if (map_it->second == "InnerProduct") |
| 934 | { |
| 935 | ExtractFCParameters(src, graph); |
| 936 | } |
| 937 | else if (map_it->second == "Argmax") |
| 938 | { |
| 939 | ExtractArgmaxParameters(src, graph); |
| 940 | } |
| 941 | else if (map_it->second == "Softmax") |
| 942 | { |
| 943 | ExtractSoftmaxParameters(src, graph); |
| 944 | } |
| 945 | else if (map_it->second == "Deconvolution") |
| 946 | { |
| 947 | ExtractDeconvolutionParameters(src, graph); |
| 948 | } |
| 949 | else if (map_it->second == "Concat") |
| 950 | { |
| 951 | ExtractConcatParameters(src, graph); |
| 952 | } |
| 953 | else if (map_it->second == "Crop") |
| 954 | { |
| 955 | ExtractCropParameters(src, graph); |
| 956 | } |
| 957 | else if (map_it->second == "Flatten") |
| 958 | { |
| 959 | ExtractFlattenParameters(src, graph); |
| 960 | } |
| 961 | else if (map_it->second == "Permute") |
| 962 | { |
| 963 | ExtractPermuteParameters(src, graph); |
| 964 | } |
| 965 | else if (map_it->second == "L2Normalize") |
no test coverage detected