| 66 | } |
| 67 | |
| 68 | std::string input_shape_to_string(TContext* ctx) { |
| 69 | int nr_input = ctx->getAttrInt("nr_operands") - 1; |
| 70 | std::string result; |
| 71 | for (int i = 0; i < nr_input; i++) { |
| 72 | auto operand = ctx->getAttrOprand("operand:" + std::to_string(i)); |
| 73 | size_t nr_dim = operand.shape.size(); |
| 74 | if (nr_dim < 1) { |
| 75 | continue; |
| 76 | } |
| 77 | std::stringstream ss; |
| 78 | ss << "["; |
| 79 | for (size_t i = 0; i < operand.shape.size(); ++i) { |
| 80 | ss << operand.shape[i] << ", "; |
| 81 | } |
| 82 | ss << "]"; |
| 83 | result += ss.str(); |
| 84 | } |
| 85 | return result; |
| 86 | } |
| 87 | |
| 88 | Tensor dnntensor_2_cctensor(const megdnn::TensorND& tensor, const char* name) { |
| 89 | Tensor res; |
no test coverage detected