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

Method Prerun

executor/lib/custom_kernel_ops.cpp:40–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40bool 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
65bool CustomKernelNodeOps::Reshape(Node* node)
66{

Callers

nothing calls this directly

Calls 4

PrepareTensorsFunction · 0.85
set_tengine_errnoFunction · 0.85
IsDynamicShapeMethod · 0.80
GetNameMethod · 0.80

Tested by

no test coverage detected