| 10 | namespace CustomKernelManager { |
| 11 | |
| 12 | static void PrepareOneTensor(Node* node, Tensor* tensor, struct custom_kernel_tensor* t) |
| 13 | { |
| 14 | const TShape& shape = tensor->GetShape(); |
| 15 | const std::vector<int>& dims = shape.GetDim(); |
| 16 | |
| 17 | const ExecAttr* exec_attr = any_cast<const ExecAttr*>(node->GetAttr(ATTR_EXEC_ATTR)); |
| 18 | |
| 19 | t->dim_num = dims.size(); |
| 20 | |
| 21 | for(int i = 0; i < t->dim_num; i++) |
| 22 | { |
| 23 | t->dim[i] = dims[i]; |
| 24 | } |
| 25 | |
| 26 | t->data_type = tensor->GetDataType(); |
| 27 | t->element_num = shape.GetSize(); |
| 28 | t->element_size = DataType::GetTypeSize(t->data_type); |
| 29 | t->layout_type = exec_attr->graph_layout; |
| 30 | |
| 31 | t->data = nullptr; |
| 32 | } |
| 33 | |
| 34 | bool PrepareTensors(Node* node, struct custom_kernel_tensor**& k_inputs, int input_num, |
| 35 | struct custom_kernel_tensor**& k_outputs, int output_num) |
no test coverage detected