| 233 | } |
| 234 | |
| 235 | bool CaffeSingle::LoadNode(StaticGraph* graph, StaticNode* node, const te_caffe::LayerParameter& layer_param, |
| 236 | name_map_t& tensor_name_map) |
| 237 | { |
| 238 | for(int i = 0; i < layer_param.bottom_size(); i++) |
| 239 | { |
| 240 | const std::string& orig_name = layer_param.bottom(i); |
| 241 | |
| 242 | std::string& tensor_name = tensor_name_map[orig_name]; |
| 243 | |
| 244 | StaticTensor* tensor = FindTensor(graph, tensor_name); |
| 245 | |
| 246 | AddNodeInputTensor(node, tensor); |
| 247 | } |
| 248 | |
| 249 | for(int i = 0; i < layer_param.top_size(); i++) |
| 250 | { |
| 251 | const std::string& orig_name = layer_param.top(i); |
| 252 | std::string tensor_name; |
| 253 | |
| 254 | if(tensor_name_map.count(orig_name)) |
| 255 | tensor_name = GetNodeName(node) + "/" + std::to_string(i); |
| 256 | else |
| 257 | tensor_name = orig_name; |
| 258 | |
| 259 | StaticTensor* tensor = CreateStaticTensor(graph, tensor_name); |
| 260 | |
| 261 | SetTensorDataType(tensor, DataType::GetTypeID("float32")); |
| 262 | |
| 263 | AddNodeOutputTensor(node, tensor); |
| 264 | |
| 265 | // record the name mapping |
| 266 | |
| 267 | tensor_name_map[orig_name] = tensor_name; |
| 268 | } |
| 269 | |
| 270 | return true; |
| 271 | } |
| 272 | |
| 273 | bool CaffeSingle::LoadGraph(te_caffe::NetParameter& caffe_net, StaticGraph* graph) |
| 274 | { |
nothing calls this directly
no test coverage detected