// 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"};
// 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"};
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;
}