To remove unnecessary initiazlied value 1 in dimension array,
ml-api will save '1' only if the user explicitly defined it.
So, some conditions may need to be changed.
Change-Id: Iafb626d4c7b2322cd7e5e8d42525fc194a7b3456
Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
// Check if update is partial due to location change
bool partial = false;
for (int i = 0; i < util::kWebApiMLTensorRankLimit; i++) {
// Check if update is partial due to location change
bool partial = false;
for (int i = 0; i < util::kWebApiMLTensorRankLimit; i++) {
- if (location[i] >= dim[i]) {
+ if (location[i] >= dim[i] && location[i] > 0) {
// Input data starts outside of current data
LoggerE("Requested data location is invalid on [%d]: %u", i, location[i]);
return PlatformResult{ErrorCode::INVALID_VALUES_ERR, "Requested data location is invalid"};
// Input data starts outside of current data
LoggerE("Requested data location is invalid on [%d]: %u", i, location[i]);
return PlatformResult{ErrorCode::INVALID_VALUES_ERR, "Requested data location is invalid"};
// Check if update is partial due to location change
bool partial = false;
for (int i = 0; i < util::kWebApiMLTensorRankLimit; i++) {
// Check if update is partial due to location change
bool partial = false;
for (int i = 0; i < util::kWebApiMLTensorRankLimit; i++) {
- if (location[i] >= dim[i]) {
+ if (location[i] >= dim[i] && location[i] > 0) {
// Input data starts outside of current data
LoggerE("Input data location is invalid on [%d]: %u", i, location[i]);
return PlatformResult{ErrorCode::INVALID_VALUES_ERR, "Input data location is invalid"};
// Input data starts outside of current data
LoggerE("Input data location is invalid on [%d]: %u", i, location[i]);
return PlatformResult{ErrorCode::INVALID_VALUES_ERR, "Input data location is invalid"};
LoggerE("Input data will not fit in TensorData [%d]: %u > %u", i, size_rel[i], dim[i]);
return PlatformResult{ErrorCode::INVALID_VALUES_ERR, "Input data will not fit in TensorData"};
} else {
LoggerE("Input data will not fit in TensorData [%d]: %u > %u", i, size_rel[i], dim[i]);
return PlatformResult{ErrorCode::INVALID_VALUES_ERR, "Input data will not fit in TensorData"};
} else {
- data_to_be_updated_size *= size[i];
+ if (size[i] != 0) {
+ data_to_be_updated_size *= size[i];
+ }
if (size_rel[i] < dim[i]) {
partial = true;
}
if (size_rel[i] < dim[i]) {
partial = true;
}