diff --git a/mace/core/operator.h b/mace/core/operator.h index df488691bac3fd8de6aea9c98a7175f80b50f41e..4ec4e7b175af7ba2d6ff7af411ece348ecc6d9e7 100644 --- a/mace/core/operator.h +++ b/mace/core/operator.h @@ -44,7 +44,7 @@ class OperatorBase { *operator_def_, name, default_value); } - inline const Tensor *Input(index_t idx) { + inline const Tensor *Input(unsigned int idx) { MACE_CHECK(idx < inputs_.size()); return inputs_[idx]; } diff --git a/mace/core/tensor.h b/mace/core/tensor.h index 1af32d3f2338f344332375d9cb67cbe23a4f119d..d40d39d78220bc0e470ddc799debb2b645923dce 100644 --- a/mace/core/tensor.h +++ b/mace/core/tensor.h @@ -68,9 +68,8 @@ class Tensor { inline index_t dim_size() const { return shape_.size(); } - inline index_t dim(index_t index) const { + inline index_t dim(unsigned int index) const { MACE_CHECK(index < shape_.size(), "Exceeding ndim limit"); - MACE_CHECK(index >= 0, "Cannot have negative dimension index"); return shape_[index]; }