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

Method Prerun

executor/operator/ref/ref_eltwise.cpp:101–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101bool 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
128bool EltwiseOps::Run(Node* node)
129{

Callers

nothing calls this directly

Calls 7

set_tengine_errnoFunction · 0.85
GetQuantParamMethod · 0.80
GetDataTypeMethod · 0.80
GetInputTensorMethod · 0.45
GetOutputTensorMethod · 0.45
sizeMethod · 0.45
GetKernelMethod · 0.45

Tested by

no test coverage detected