MCPcopy Create free account
hub / github.com/MegEngine/MegCC / input_shape_to_string

Function input_shape_to_string

compiler/test/kernel/common/src/cc_proxy.cpp:68–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68std::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
88Tensor dnntensor_2_cctensor(const megdnn::TensorND& tensor, const char* name) {
89 Tensor res;

Callers 2

gen_kernelFunction · 0.85
call_kernelFunction · 0.85

Calls 2

getAttrOprandMethod · 0.80
to_stringFunction · 0.70

Tested by

no test coverage detected