Skip to content

Commit 54ba8ea

Browse files
authored
Merge pull request #1250 from reyoung/feature/remove_compile_warnings
Remove compile warning on AppleClang 8.0 in BufferArg.h
2 parents df2ecc5 + 7c04096 commit 54ba8ea

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

paddle/function/BufferArg.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ class SequenceIdArg : public BufferArg {
189189
SequenceIdArg(const TensorShape& shape, ArgType argType = UNSPECIFIED)
190190
: BufferArg(VALUE_TYPE_INT32, shape, argType) {
191191
bufferType_ = TENSOR_SEQUENCE_ID;
192-
CHECK_EQ(shape_.ndims(), (size_t)1);
193-
CHECK_GT(shape_[0], 1);
192+
CHECK_EQ(shape_.ndims(), 1UL);
193+
CHECK_GT(shape_[0], 1UL);
194194
numSeqs_ = shape_[0] - 1;
195195
}
196196

@@ -199,7 +199,7 @@ class SequenceIdArg : public BufferArg {
199199
ArgType argType = UNSPECIFIED)
200200
: BufferArg(buf, VALUE_TYPE_INT32, shape, argType) {
201201
bufferType_ = TENSOR_SEQUENCE_ID;
202-
CHECK_EQ(shape_.ndims(), (size_t)1);
202+
CHECK_EQ(shape_.ndims(), 1UL);
203203
numSeqs_ = shape_[0] - 1;
204204
}
205205

@@ -280,9 +280,9 @@ class SparseMatrixArg : public BufferArg {
280280
type_(static_cast<SparseDataType>(type)) {
281281
bufferType_ = TENSOR_SPARSE;
282282
CHECK((valueType == VALUE_TYPE_FLOAT) || (valueType == VALUE_TYPE_DOUBLE));
283-
CHECK_EQ(shape_.ndims(), (size_t)2);
284-
CHECK_EQ(row_.shape().ndims(), (size_t)1);
285-
CHECK_EQ(col_.shape().ndims(), (size_t)1);
283+
CHECK_EQ(shape_.ndims(), 2UL);
284+
CHECK_EQ(row_.shape().ndims(), 1UL);
285+
CHECK_EQ(col_.shape().ndims(), 1UL);
286286
if (format_ == T_SPARSE_CSR) {
287287
CHECK_EQ(nnz, col.shape()[0]);
288288
} else if (format_ == T_SPARSE_CSC) {
@@ -304,7 +304,7 @@ class SparseMatrixArg : public BufferArg {
304304
type_(static_cast<SparseDataType>(type)) {
305305
bufferType_ = TENSOR_SPARSE;
306306
CHECK((valueType == VALUE_TYPE_FLOAT) || (valueType == VALUE_TYPE_DOUBLE));
307-
CHECK_EQ(shape_.ndims(), (size_t)2);
307+
CHECK_EQ(shape_.ndims(), 2UL);
308308

309309
/// len of row_ : height + 1 (CSR) or nnz (CSC), buf_ == nullptr
310310
row_ = (format_ == T_SPARSE_CSR
@@ -325,7 +325,7 @@ class SparseMatrixArg : public BufferArg {
325325
CHECK(buf_);
326326
CHECK(valueType_ == DataType<real>::value);
327327
// CHECK(deviceType_ == DType);
328-
CHECK_EQ(2, shape_.ndims());
328+
CHECK_EQ(2UL, shape_.ndims());
329329
return typename Tensor<real, DType>::SparseMatrix(
330330
reinterpret_cast<real*>(buf_),
331331
reinterpret_cast<int*>(row_.data()),

0 commit comments

Comments
 (0)