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

Function start_callback_with_data

lite/test/test_network_c.cpp:99–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98volatile bool start_checked_with_data = false;
99int start_callback_with_data(
100 const LiteIO* inputs, const LiteTensor* input_tensors, size_t size,
101 void* user_data) {
102 start_checked_with_data = true;
103 auto check_func = [&]() {
104 if (user_data != NULL) {
105 std::cout << "start_callback user_data addr=" << std::hex << user_data
106 << std::endl;
107 }
108 ASSERT_EQ(size, 1);
109 ASSERT_EQ(std::string(inputs->name), "data");
110 LiteLayout layout;
111 LITE_get_tensor_layout(*input_tensors, &layout);
112 ASSERT_EQ(layout.ndim, 4);
113 ASSERT_EQ(layout.shapes[1], 3);
114 ASSERT_EQ(layout.shapes[2], 224);
115 ASSERT_EQ(layout.shapes[3], 224);
116 };
117 check_func();
118 return 0;
119}
120
121volatile bool finish_checked = false;
122int finish_callback(

Callers

nothing calls this directly

Calls 1

LITE_get_tensor_layoutFunction · 0.85

Tested by

no test coverage detected