MCPcopy Create free account
hub / github.com/OAID/Tengine / LoadGeneric

Function LoadGeneric

tengine-module/plugin/serializer/tensorflow/tf_serializer.cpp:3346–3374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3344}
3345
3346static 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
3376static bool LoadLSTMInitState(LSTMNode* lstm_node, TFNode* init_node, StaticGraph* graph)
3377{

Callers

nothing calls this directly

Calls 7

CreateStaticOpFunction · 0.85
AddOperatorAttrFunction · 0.85
SetOperatorParamFunction · 0.85
SetNodeOpFunction · 0.85
AddNodeInputTensorFunction · 0.85
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected