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

Method PrepareTensors

executor/lib/custom_kernel_ops.cpp:129–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129bool CustomKernelNodeOps::PrepareTensors(Node* node)
130{
131 /*prepare inputs and outputs */
132 input_num_ = node->GetInputNum();
133 output_num_ = node->GetOutputNum();
134
135 if(!CustomKernelManager::PrepareTensors(node, k_inputs_, input_num_, k_outputs_, output_num_))
136 return false;
137
138 /* set mem in tensor */
139 for(int i = 0; i < input_num_; i++)
140 {
141 Tensor* tensor = node->GetInputTensor(i);
142 struct custom_kernel_tensor* t = k_inputs_[i];
143
144 t->data = get_tensor_mem(tensor);
145 }
146
147 for(int i = 0; i < output_num_; i++)
148 {
149 Tensor* tensor = node->GetOutputTensor(i);
150 struct custom_kernel_tensor* t = k_outputs_[i];
151
152 t->data = get_tensor_mem(tensor);
153 }
154
155 return true;
156}
157
158void CustomKernelNodeOps::ReleaseTensors(Node* node)
159{

Callers

nothing calls this directly

Calls 6

PrepareTensorsFunction · 0.85
get_tensor_memFunction · 0.85
GetInputNumMethod · 0.45
GetOutputNumMethod · 0.45
GetInputTensorMethod · 0.45
GetOutputTensorMethod · 0.45

Tested by

no test coverage detected