| 3344 | } |
| 3345 | |
| 3346 | static bool LoadGeneric(TFNode* tf_node, TFGraph& tf_graph, StaticGraph* graph) |
| 3347 | { |
| 3348 | StaticNode* node = tf_node->static_node; |
| 3349 | |
| 3350 | StaticOp* op = CreateStaticOp(graph, "Generic"); |
| 3351 | |
| 3352 | GenericParam generic_param = any_cast<GenericParam>(OpManager::GetOpDefParam("Generic")); |
| 3353 | |
| 3354 | /* a little bit ugly, any better solution? */ |
| 3355 | std::string* saved_name = new std::string(tf_node->op); |
| 3356 | std::shared_ptr<std::string> for_free(saved_name); |
| 3357 | AddOperatorAttr(op, "For_Free_Generic_OP", for_free); |
| 3358 | |
| 3359 | generic_param.op_name = saved_name->c_str(); |
| 3360 | generic_param.max_input_num = tf_node->inputs.size(); |
| 3361 | generic_param.max_output_num = tf_node->outputs.size(); |
| 3362 | |
| 3363 | SetOperatorParam(op, generic_param); |
| 3364 | |
| 3365 | SetNodeOp(node, op); |
| 3366 | |
| 3367 | for(unsigned int i = 0; i < tf_node->inputs.size(); i++) |
| 3368 | { |
| 3369 | TFNode* input = tf_node->inputs[i]; |
| 3370 | AddNodeInputTensor(node, input->static_tensor); |
| 3371 | } |
| 3372 | |
| 3373 | return true; |
| 3374 | } |
| 3375 | |
| 3376 | static bool LoadLSTMInitState(LSTMNode* lstm_node, TFNode* init_node, StaticGraph* graph) |
| 3377 | { |
nothing calls this directly
no test coverage detected