| 99 | } |
| 100 | |
| 101 | bool EltwiseOps::Prerun(Node* node) |
| 102 | { |
| 103 | int layout = exec_attr->graph_layout; |
| 104 | Tensor* input_tensor = node->GetInputTensor(0); |
| 105 | Tensor* output_tensor = node->GetOutputTensor(0); |
| 106 | auto* o_quant = output_tensor->GetQuantParam(); |
| 107 | if (input_tensor->GetDataType() == TENGINE_DT_UINT8 || input_tensor->GetDataType() == TENGINE_DT_INT8) |
| 108 | { |
| 109 | if (o_quant->size() == 0) |
| 110 | { |
| 111 | return false; |
| 112 | } |
| 113 | op_param.scale[2] = (*o_quant)[0].scale; |
| 114 | op_param.zero[2] = (*o_quant)[0].zero_point; |
| 115 | } |
| 116 | op_param.layout = layout; |
| 117 | if(!kernel_registry.GetKernel(kernel_run, layout, input_tensor->GetDataType())) |
| 118 | { |
| 119 | set_tengine_errno(ENOENT); |
| 120 | return false; |
| 121 | } |
| 122 | |
| 123 | // int elem_size=DataType::GetTypeSize(input->GetDataType()); |
| 124 | |
| 125 | return true; |
| 126 | } |
| 127 | |
| 128 | bool EltwiseOps::Run(Node* node) |
| 129 | { |
nothing calls this directly
no test coverage detected