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

Function LITE_get_discrete_tensor

lite/lite-c/src/network.cpp:283–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283int LITE_get_discrete_tensor(
284 LiteNetwork network, const char* io_name, size_t n_idx, LiteTensorPhase phase,
285 LiteTensor* tensor) {
286 LITE_CAPI_BEGIN();
287 LITE_ASSERT(network, "The network pass to LITE api is null");
288 auto io_tensors =
289 static_cast<lite::Network*>(network)->get_discrete_tensors(io_name, phase);
290 LITE_ASSERT(
291 n_idx < io_tensors.size(), "n_idx should be less than %zu",
292 io_tensors.size());
293 *tensor = io_tensors[n_idx].get();
294 LITE_CAPI_END();
295}
296
297int LITE_get_input_name(const LiteNetwork network, size_t index, const char** name) {
298 LITE_CAPI_BEGIN();

Callers 1

TESTFunction · 0.85

Calls 3

get_discrete_tensorsMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by 1

TESTFunction · 0.68