MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / LITE_tensor_reshape

Function LITE_tensor_reshape

lite/lite-c/src/tensor.cpp:107–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107int LITE_tensor_reshape(LiteTensor tensor, const int* shape, int size) {
108 LITE_CAPI_BEGIN();
109 LITE_ASSERT(tensor && shape, "The tensor pass to LITE c_api is null");
110 std::vector<int> shapes;
111 for (int i = 0; i < size; i++) {
112 shapes.push_back(shape[i]);
113 }
114 static_cast<lite::Tensor*>(tensor)->reshape(shapes);
115 LITE_CAPI_END();
116}
117
118int LITE_tensor_slice(
119 const LiteTensor tensor, const size_t* start, const size_t* end,

Callers 1

TESTFunction · 0.85

Calls 2

push_backMethod · 0.45
reshapeMethod · 0.45

Tested by 1

TESTFunction · 0.68