Skip to content

Commit

Permalink
[UnitTest] Update Integration_test_fsu
Browse files Browse the repository at this point in the history
Update Integration_test FSU case
- Label & Optimizer no longer need at inference case
- so update unit test

**Self evaluation:**
1. Build test:	 [X]Passed [ ]Failed [ ]Skipped
2. Run test:	 [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Donghak PARK <[email protected]>
  • Loading branch information
DonghakPark authored and jijoongmoon committed Feb 20, 2025
1 parent 873c7b1 commit 0179bd5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/unittest/integration_tests/integration_test_fsu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ TEST(fsu, simple_fc) {

model->addLayer(ml::train::createLayer(
"input", {withKey("name", "input0"), withKey("input_shape", "1:1:320")}));

for (int i = 0; i < 6; i++) {
model->addLayer(ml::train::createLayer(
"fully_connected",
{withKey("unit", 1000), withKey("weight_initializer", "xavier_uniform"),
withKey("bias_initializer", "zeros")}));
}

model->addLayer(ml::train::createLayer(
"fully_connected",
{withKey("unit", 100), withKey("weight_initializer", "xavier_uniform"),
Expand All @@ -75,9 +77,6 @@ TEST(fsu, simple_fc) {
withKey("memory_swap_lookahead", "1"),
withKey("model_tensor_type", "FP16-FP16")});

auto optimizer = ml::train::createOptimizer("sgd", {"learning_rate=0.001"});
model->setOptimizer(std::move(optimizer));

int status = model->compile(ml::train::ExecutionMode::INFERENCE);
EXPECT_EQ(status, ML_ERROR_NONE);

Expand All @@ -89,20 +88,17 @@ TEST(fsu, simple_fc) {
model->load("./simplefc_weight_fp16_fp16_100.bin");

unsigned int feature_size = 320;

float input[320];

for (unsigned int j = 0; j < feature_size; ++j)
input[j] = j;

std::vector<float *> in;
std::vector<float *> l;
std::vector<float *> answer;

in.push_back(input);

answer = model->inference(1, in, l);
answer = model->inference(1, in);

in.clear();
l.clear();
}

0 comments on commit 0179bd5

Please sign in to comment.