| 2515 | } |
| 2516 | |
| 2517 | static bool LoadSoftmax(TFNode* tf_node, TFGraph& tf_graph, StaticGraph* graph) |
| 2518 | { |
| 2519 | TFNode* input = tf_node->inputs[0]; |
| 2520 | StaticNode* node = tf_node->static_node; |
| 2521 | AddNodeInputTensor(node, input->static_tensor); |
| 2522 | |
| 2523 | SoftmaxParam param = any_cast<SoftmaxParam>(OpManager::GetOpDefParam("Softmax")); |
| 2524 | /* it seems tensorflow justs support last dimension */ |
| 2525 | const tensorflow::NodeDef* node_def = tf_node->pb_defs[0]; |
| 2526 | tensorflow::AttrValue value; |
| 2527 | if(GetAttrValue(node_def, "value", value)) |
| 2528 | { |
| 2529 | const tensorflow::TensorProto& tf_tensor = value.tensor(); |
| 2530 | int axis = tf_tensor.int_val(0); |
| 2531 | param.axis = axis; |
| 2532 | } |
| 2533 | else |
| 2534 | param.axis = 3; |
| 2535 | |
| 2536 | StaticOp* op = CreateStaticOp(graph, "Softmax"); |
| 2537 | SetOperatorParam(op, param); |
| 2538 | SetNodeOp(node, op); |
| 2539 | |
| 2540 | AddGraphOutputNode(graph, node); |
| 2541 | |
| 2542 | return true; |
| 2543 | } |
| 2544 | |
| 2545 | static bool LoadRelu(TFNode* tf_node, TFGraph& tf_graph, StaticGraph* graph) |
| 2546 | { |
nothing calls this directly
no test coverage detected