| 38 | } |
| 39 | |
| 40 | bool CustomKernelNodeOps::Prerun(Node* node) |
| 41 | { |
| 42 | if(k_ops_->prerun == nullptr) |
| 43 | return true; |
| 44 | |
| 45 | assert(input_num_ == 0 && output_num_ == 0); |
| 46 | assert(k_inputs_ == nullptr && k_outputs_ == nullptr); |
| 47 | |
| 48 | if(!PrepareTensors(node)) |
| 49 | return false; |
| 50 | |
| 51 | int dynamic_shape = node->IsDynamicShape() ? 1 : 0; |
| 52 | |
| 53 | int ret = k_ops_->prerun(k_ops_, k_inputs_, input_num_, k_outputs_, output_num_, dynamic_shape); |
| 54 | |
| 55 | if(ret < 0) |
| 56 | { |
| 57 | LOG_ERROR() << "custom kernel prerun failed on node: " << node->GetName() << "\n"; |
| 58 | set_tengine_errno(EFAULT); // external error |
| 59 | return false; |
| 60 | } |
| 61 | |
| 62 | return true; |
| 63 | } |
| 64 | |
| 65 | bool CustomKernelNodeOps::Reshape(Node* node) |
| 66 | { |
nothing calls this directly
no test coverage detected