[loader] Change semantics of path in ini
authorJihoon Lee <jhoon.it.lee@samsung.com>
Fri, 12 Mar 2021 11:09:41 +0000 (20:09 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Tue, 16 Mar 2021 07:11:21 +0000 (16:11 +0900)
commit22b69ce2fe1cf84515c292786c40d6efdc957910
tree25ea5003e03000c6504e774358931efe00f903c4
parent6a3fdbf063c271af97c77e71acfe8174886c2d32
[loader] Change semantics of path in ini

Ini description is expected to be somewhat determinisitic.

But paths inside ini is not deterministic. For example, if you have
save_path=model.bin,

if A application trains it and B application try to use it, reading the
same ini does not gaurantee B to read to the weights from A.

It is because A and B can have diffrent working path.

To make it consistent, this patch changes semantics of paths' in ini.

1. if model.appcontext.hasWorkingDirectory(), path inside ini are interpreted from
the workingDirectory
2. else, it is interpreted **relative to where ini is located at.**

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

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
nntrainer/app_context.cpp
nntrainer/app_context.h
nntrainer/models/model_loader.cpp
nntrainer/models/model_loader.h
test/test_models/models/mnist.ini
test/test_models/models/mnist_inf.ini
test/unittest/unittest_nntrainer_modelfile.cpp