pytorch
25179ecb - [caffe2] Fix verbose templated signed/unsigned comparison warning (#59578)

Commit
3 years ago
[caffe2] Fix verbose templated signed/unsigned comparison warning (#59578) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/59578 This is verbose warning formed from one `CAFFE_ENFORCE_GT()` check: ``` third-party\toolchains\vs2017_15.9\buildtools\vc\tools\msvc\14.16.27023\include\xstddef(271): warning C4018: '>': signed/unsigned mismatch xplat\caffe2\c10\util\logging.h(208): note: see reference to function template instantiation 'bool std::greater<void>::operator ()<const T1&,const T2&>(_Ty1,_Ty2) const' being compiled with [ T1=int, T2=unsigned int, _Ty1=const int &, _Ty2=const unsigned int & ] xplat\caffe2\caffe2\operators\conv_pool_op_base.h(539): note: see reference to function template instantiation 'void c10::enforce_detail::enforceThatImpl<std::greater<void>,int,unsigned int,>(Pred,const T1 &,const T2 &,const char *,int,const char *,const void *)' being compiled with [ Pred=std::greater<void>, T1=int, T2=unsigned int ] xplat\caffe2\caffe2\operators\conv_pool_op_base.h(536): note: while compiling class template member function 'std::vector<caffe2::TensorShape,std::allocator<_Ty>> caffe2::ConvPoolOpBase<caffe2::CPUContext>::TensorInferenceForSchema(const caffe2::OperatorDef &,const std::vector<_Ty,std::allocator<_Ty>> &,int)' with [ _Ty=caffe2::TensorShape ] xplat\caffe2\caffe2\operators\conv_pool_op_base.h(631): note: see reference to function template instantiation 'std::vector<caffe2::TensorShape,std::allocator<_Ty>> caffe2::ConvPoolOpBase<caffe2::CPUContext>::TensorInferenceForSchema(const caffe2::OperatorDef &,const std::vector<_Ty,std::allocator<_Ty>> &,int)' being compiled with [ _Ty=caffe2::TensorShape ] xplat\caffe2\caffe2\operators\pool_op.cc(1053): note: see reference to class template instantiation 'caffe2::ConvPoolOpBase<caffe2::CPUContext>' being compiled xplat\caffe2\c10\core\memoryformat.h(63): note: see reference to class template instantiation 'c10::ArrayRef<int64_t>' being compiled ``` Use a signed `0` because `.dims_size()` returns a signed integer. Test Plan: Confirm warning no longer present in Windows build logs Reviewed By: simpkins Differential Revision: D28941905 fbshipit-source-id: acdc1281df2fe7f30b14cfad917cbbe8f3336d29
Author
Parents
Loading