From 5ab958ba3b9a49ab8ea9891710bda7c8e6a61a70 Mon Sep 17 00:00:00 2001 From: dzhwinter Date: Tue, 6 Jun 2017 01:14:21 +0800 Subject: [PATCH] "change size_t type to avoid warning" --- paddle/optimizer/Tensor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/optimizer/Tensor.h b/paddle/optimizer/Tensor.h index fbfba4806..41afacd75 100644 --- a/paddle/optimizer/Tensor.h +++ b/paddle/optimizer/Tensor.h @@ -23,11 +23,11 @@ public: this->data_ = t.get_buffer(); } T* get_buffer() { return this->data_; } - T& operator[](const int idx) { + T& operator[](const size_t idx) { CHECK(idx >= 0 && idx < this->width_) << "out of index range"; return data_[idx]; } - T& operator[](const int idx) const { + T& operator[](const size_t idx) const { CHECK(idx >= 0 && idx < this->width_) << "out of index range"; return data_[idx]; } -- GitLab