| 127 | } |
| 128 | |
| 129 | bool 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 | |
| 158 | void CustomKernelNodeOps::ReleaseTensors(Node* node) |
| 159 | { |
nothing calls this directly
no test coverage detected