Add exception to TensorDim::setTensorDim
authorJihoon Lee <jhoon.it.lee@samsung.com>
Thu, 25 Jun 2020 10:23:53 +0000 (19:23 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Fri, 3 Jul 2020 02:30:54 +0000 (11:30 +0900)
commite4e47a39cd804fc83a8d1f85490ec6dd257ba08f
tree176a01186677c8ba38549f7b65ed7225e831b98b
parent8d10ef6fd631e8b752d31d587e7bd28a87f3c188
Add exception to TensorDim::setTensorDim

**Prerequisite**
- Add capi exception wrapper (later pr)

**Changes proposed in this PR:**
- Add `std::invalid_argument` to `TensorDim::setTensorDim`
- Fix `fc_layer` positive test does not have unit declared.
- Fix tests accordingly.
- Add TensorDim test (positive && negative)

**Todo**
- ~Add TensorDim test (positive && negative)~

See also: #233

**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>
17 files changed:
nntrainer/include/tensor_dim.h
nntrainer/src/activation_layer.cpp
nntrainer/src/bn_layer.cpp
nntrainer/src/conv2d_layer.cpp
nntrainer/src/databuffer.cpp
nntrainer/src/fc_layer.cpp
nntrainer/src/flatten_layer.cpp
nntrainer/src/input_layer.cpp
nntrainer/src/layer.cpp
nntrainer/src/loss_layer.cpp
nntrainer/src/optimizer.cpp
nntrainer/src/pooling2d_layer.cpp
nntrainer/src/tensor_dim.cpp
test/unittest/unittest_databuffer_file.cpp
test/unittest/unittest_nntrainer_internal.cpp
test/unittest/unittest_nntrainer_layers.cpp
test/unittest/unittest_nntrainer_tensor.cpp