| 4022 | } |
| 4023 | |
| 4024 | static bool LoadTopkV2(TFNode* tf_node, TFGraph& tf_graph, StaticGraph* graph) |
| 4025 | { |
| 4026 | StaticNode* node = tf_node->static_node; |
| 4027 | TFNode* input0 = tf_node->inputs[0]; |
| 4028 | TFNode* input1 = tf_node->inputs[1]; |
| 4029 | AddNodeInputTensor(node, input0->static_tensor); |
| 4030 | StaticTensor* tensor = input1->static_tensor; |
| 4031 | std::vector<int> dims; |
| 4032 | dims.push_back(1); |
| 4033 | SetTensorDim(tensor, dims); |
| 4034 | AddNodeInputTensor(node, input1->static_tensor); |
| 4035 | StaticOp* op = CreateStaticOp(graph, "TopKV2"); |
| 4036 | TopKV2Param param = any_cast<TopKV2Param>(OpManager::GetOpDefParam("TopKV2")); |
| 4037 | |
| 4038 | const tensorflow::NodeDef* node_def = tf_node->pb_defs[0]; |
| 4039 | tensorflow::AttrValue value0; |
| 4040 | GetAttrValue(node_def, "sorted", value0); |
| 4041 | param.sorted = value0.b(); |
| 4042 | |
| 4043 | int* value = ( int* )LoadConstParam(input1); |
| 4044 | param.k = value[0]; |
| 4045 | SetOperatorParam(op, param); |
| 4046 | SetNodeOp(node, op); |
| 4047 | |
| 4048 | StaticTensor* output1 = CreateStaticTensor(graph, "output1"); |
| 4049 | SetTensorDataType(output1, DataType::GetTypeID("float32")); |
| 4050 | AddNodeOutputTensor(node, output1); |
| 4051 | |
| 4052 | return true; |
| 4053 | } |
| 4054 | |
| 4055 | static bool LoadFloor(TFNode* tf_node, TFGraph& tf_graph, StaticGraph* graph) |
| 4056 | { |
nothing calls this directly
no test coverage detected