apeforest commented on a change in pull request #17444: [Large Tensor] Add LT
support for NN optimizers and 1 activation function
URL: https://github.com/apache/incubator-mxnet/pull/17444#discussion_r374280693
##########
File path: src/operator/optimizer_op-inl.h
##########
@@ -225,7 +225,7 @@ struct MultiSGDKernelParam {
template <typename MPDType, bool has_momentum, bool has_mixed_precision>
struct MultiSGDKernel {
template<typename DType>
- MSHADOW_XINLINE static void Map(int i, const MultiSGDKernelParam<DType,
MPDType>& param,
+ MSHADOW_XINLINE static void Map(index_t i, const MultiSGDKernelParam<DType,
MPDType>& param,
const OpReqType req) {
for (int index = 0; index < param.count; ++index) {
if ((size_t)i < param.sizes[index]) {
Review comment:
@ChaiBapchya size_t is platform dependent. It is safer to static_cast
param.sizes[index] to index_t. When large tensor is not enabled and
param.sizes[index] is greater than 2^32 we already have error check at python
level.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services