Merge pull request !20166 from ling/test_data
This commit is contained in:
i-robot 2021-07-14 00:49:05 +00:00 committed by Gitee
commit c5c36a2c75
29 changed files with 45 additions and 43 deletions

View File

@ -76,34 +76,39 @@ TEST_F(GraphTest, UserSetGraphOutput1) {
ASSERT_EQ(benchmark_ret, lite::RET_OK);
delete session;
static int output_count = 0;
/* output data control by users */
for (auto out_data : out_datas) {
string name = out_data.first;
void *data = out_data.second;
float *fp32_data = reinterpret_cast<float *>(data);
if (name == "Conv2D-7") {
ASSERT_LE(fabs(fp32_data[0] - (-0.01506812)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (0.007832255)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (-0.00440396)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (0.000382302)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (0.001282413)), 0.01);
if (name == "Stack-8") {
output_count++;
ASSERT_LE(fabs(fp32_data[0] - (0.115831)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (0.113074)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (0.245932)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (0.346307)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (-0.15687)), 0.01);
}
if (name == "Conv2D-8") {
ASSERT_LE(fabs(fp32_data[0] - (0.019412944)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (-0.01643771)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (0.001904978)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (-0.00486740)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (0.009935631)), 0.01);
if (name == "Stack-10") {
output_count++;
ASSERT_LE(fabs(fp32_data[0] - (0.06387864)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (0.22883008)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (0.23308714)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (0.04586578)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (0.06820235)), 0.01);
}
if (name == "Conv2D-9") {
ASSERT_LE(fabs(fp32_data[0] - (-0.012825339)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (-0.012769699)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (-0.004285028)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (-0.002383671)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (-0.005860286)), 0.01);
if (name == "Stack-13") {
output_count++;
ASSERT_LE(fabs(fp32_data[0] - (-0.1617176)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (-0.3828573)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (0.08357508)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (0.10217983)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (-0.3480084)), 0.01);
}
free(data);
}
ASSERT_EQ(output_count, 3);
}
TEST_F(GraphTest, UserSetGraphOutput2) {
@ -157,25 +162,25 @@ TEST_F(GraphTest, UserSetGraphOutput2) {
void *out_data = out_datas[i];
float *fp32_data = reinterpret_cast<float *>(out_data);
if (i == 0) {
ASSERT_LE(fabs(fp32_data[0] - (-0.01506812)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (0.007832255)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (-0.00440396)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (0.000382302)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (0.001282413)), 0.01);
ASSERT_LE(fabs(fp32_data[0] - (0.115831)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (0.113074)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (0.245932)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (0.346307)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (-0.15687)), 0.01);
}
if (i == 1) {
ASSERT_LE(fabs(fp32_data[0] - (0.019412944)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (-0.01643771)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (0.001904978)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (-0.00486740)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (0.009935631)), 0.01);
ASSERT_LE(fabs(fp32_data[0] - (0.06387864)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (0.22883008)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (0.23308714)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (0.04586578)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (0.06820235)), 0.01);
}
if (i == 2) {
ASSERT_LE(fabs(fp32_data[0] - (-0.012825339)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (-0.012769699)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (-0.004285028)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (-0.002383671)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (-0.005860286)), 0.01);
ASSERT_LE(fabs(fp32_data[0] - (-0.1617176)), 0.01);
ASSERT_LE(fabs(fp32_data[1] - (-0.3828573)), 0.01);
ASSERT_LE(fabs(fp32_data[2] - (0.08357508)), 0.01);
ASSERT_LE(fabs(fp32_data[3] - (0.10217983)), 0.01);
ASSERT_LE(fabs(fp32_data[4] - (-0.3480084)), 0.01);
}
free(out_data);
}

View File

@ -74,7 +74,7 @@ int CheckOffline1(session::LiteSession *session) {
/* sub-graph-3 */
kernel::SubGraphKernel *subgraph3 = reinterpret_cast<kernel::SubGraphKernel *>(kernels[3]);
std::vector<kernel::LiteKernel *> nodes3 = subgraph3->nodes();
if (nodes3.size() != 8) {
if (nodes3.size() != 12) {
return -8;
}
if (nodes3[0]->type() != schema::PrimitiveType_Concat) {

View File

@ -1 +0,0 @@
¦êœ¿´Xã>+ Î?6Å@?Ü•<C39C>¿Çe¥?š;¿–ˆÜ¿Úþ?Æ„R?<3F>ÇÓ?ñýèÀí¾P<>¿`Ú„=¼»?æ?¨¥Ž¿ñ<C2BF>C¿mÄÇ?òßH?õ¤¾<±ž¿ÀŸ€<º?ÀŸâ<Cû»?À<C380>=ŽúN?Ü턾<02>±¿¹ÎÏ¿êà׿°ýB>ŠÚˆ¿<CB86>3?þ:v¿<76> ½?<3F>”¾¿-Œ¨?

View File

@ -1,2 +0,0 @@
gçÅ%Q—D§~×Äå…Å7áOÅ <C385> EÇ
Ät6<EFBFBD>ÆØÅ£¢Eµ[ÅXÓDçžÄ'U1E°vD^Ü»ÄBÃEŒ¹)EÙôAšÑAE*O{Eš3Å4ÂÎEyšCÆÕÿñÄB<C384>ùDÛ¥aÅxK´ÃFËDu®àÄRèîD='×&D,N~EpjZÄœÊñEb®OA¥[îDÔvEpt¦ÂØršÄ…#¯C©„¡Dð¢ÆÜ+ÜEð<45>C"DZÅ3bŸEø‰Ä^[ÜÃ<k_Eú Å€CÅE-û7Ã.ºÅ†&\ÅÃÆEEÏÚ*źN]DZO DJE«E<C2AB>~ÇÅÀö#Æts>EnÄ@}5E M9Åž3±ÅÚcšÄJôíDšE(\âÃÐ}ôÄÛÚ.EžjÅõi±DؘNÅÆkýÄ |2Ä4 {E