marcoabreu closed pull request #12352: [MXNET-860] Update to modern nullptr
usage
URL: https://github.com/apache/incubator-mxnet/pull/12352
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/.clang-tidy b/.clang-tidy
index c84ba323b60..af99026e5d7 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -54,7 +54,7 @@ Checks: >
# In order to trigger an error, you must have a rule defined both in checks
and in this section.
WarningsAsErrors: >
- cppcoreguidelines-no-malloc, performance-unnecessary-copy-initialization
+ cppcoreguidelines-no-malloc, modernize-use-nullptr,
performance-unnecessary-copy-initialization
# Todo: define a better regex match that includes most project headers, but
excludes third party
# code.
diff --git a/src/c_api/c_api_executor.cc b/src/c_api/c_api_executor.cc
index b99350525bf..c3a64736c01 100644
--- a/src/c_api/c_api_executor.cc
+++ b/src/c_api/c_api_executor.cc
@@ -130,7 +130,7 @@ int MXExecutorBindX(SymbolHandle symbol_handle,
num_map_keys, map_keys, map_dev_types, map_dev_ids,
len, in_args, arg_grad_store, grad_req_type,
aux_states_len, aux_states,
- NULL, out);
+ nullptr, out);
}
int MXExecutorBindEX(SymbolHandle symbol_handle,
diff --git a/src/io/iter_image_det_recordio.cc
b/src/io/iter_image_det_recordio.cc
index b9337002661..62e362c1727 100644
--- a/src/io/iter_image_det_recordio.cc
+++ b/src/io/iter_image_det_recordio.cc
@@ -303,7 +303,7 @@ inline void ImageDetRecordIOParser<DType>::Init(
dmlc::InputSplit::Blob blob;
while (reader.NextRecord(&blob)) {
rec.Load(blob.dptr, blob.size);
- if (rec.label != NULL) {
+ if (rec.label != nullptr) {
if (param_.label_width > 0) {
CHECK_EQ(param_.label_width, rec.num_label)
<< "rec file provide " << rec.num_label << "-dimensional label
"
@@ -416,7 +416,7 @@ ParseNext(std::vector<InstVector<DType>> *out_vec) {
std::vector<float> label_buf;
if (this->label_map_ != nullptr) {
label_buf = label_map_->FindCopy(rec.image_index());
- } else if (rec.label != NULL) {
+ } else if (rec.label != nullptr) {
if (param_.label_width > 0) {
CHECK_EQ(param_.label_width, rec.num_label)
<< "rec file provide " << rec.num_label << "-dimensional label "
diff --git a/src/io/iter_image_recordio.cc b/src/io/iter_image_recordio.cc
index e8dcbef2e90..066cad97377 100644
--- a/src/io/iter_image_recordio.cc
+++ b/src/io/iter_image_recordio.cc
@@ -226,7 +226,7 @@ ParseNext(std::vector<InstVector<DType>> *out_vec) {
mshadow::Tensor<cpu, 1> label = out.label().Back();
if (label_map_ != nullptr) {
mshadow::Copy(label, label_map_->Find(rec.image_index()));
- } else if (rec.label != NULL) {
+ } else if (rec.label != nullptr) {
CHECK_EQ(param_.label_width, rec.num_label)
<< "rec file provide " << rec.num_label << "-dimensional label "
"but label_width is set to " << param_.label_width;
diff --git a/src/io/iter_image_recordio_2.cc b/src/io/iter_image_recordio_2.cc
index b6ff6e99b03..846d1abccbb 100644
--- a/src/io/iter_image_recordio_2.cc
+++ b/src/io/iter_image_recordio_2.cc
@@ -303,7 +303,7 @@ inline bool
ImageRecordIOParser2<DType>::ParseNext(DataBatch *out) {
if (!legacy_shuffle_) {
n_to_out = ParseChunk(data_dptr, label_dptr, current_size, &chunk);
} else {
- n_to_out = ParseChunk(NULL, NULL, batch_param_.batch_size, &chunk);
+ n_to_out = ParseChunk(nullptr, nullptr, batch_param_.batch_size,
&chunk);
}
// Count number of parsed images that do not fit into current out
n_parsed_ = inst_order_.size();
@@ -542,7 +542,7 @@ inline unsigned
ImageRecordIOParser2<DType>::ParseChunk(DType* data_dptr, real_t
std::vector<float> label_buf;
if (label_map_ != nullptr) {
label_buf = label_map_->FindCopy(rec.image_index());
- } else if (rec.label != NULL) {
+ } else if (rec.label != nullptr) {
CHECK_EQ(param_.label_width, rec.num_label)
<< "rec file provide " << rec.num_label << "-dimensional label "
"but label_width is set to " << param_.label_width;
@@ -624,7 +624,7 @@ inline void
ImageRecordIOParser2<DType>::CreateMeanImg(void) {
while (source_->NextChunk(&chunk)) {
inst_order_.clear();
// Parse chunk w/o putting anything in out
- ParseChunk(NULL, NULL, batch_param_.batch_size, &chunk);
+ ParseChunk(nullptr, nullptr, batch_param_.batch_size, &chunk);
for (unsigned i = 0; i < inst_order_.size(); ++i) {
std::pair<unsigned, unsigned> place = inst_order_[i];
mshadow::Tensor<cpu, 3> outimg =
diff --git a/src/io/iter_mnist.cc b/src/io/iter_mnist.cc
index 1882a560d55..40223472c96 100644
--- a/src/io/iter_mnist.cc
+++ b/src/io/iter_mnist.cc
@@ -80,11 +80,11 @@ struct MNISTParam : public dmlc::Parameter<MNISTParam> {
class MNISTIter: public IIterator<TBlobBatch> {
public:
MNISTIter(void) : loc_(0), inst_offset_(0) {
- img_.dptr_ = NULL;
+ img_.dptr_ = nullptr;
out_.data.resize(2);
}
virtual ~MNISTIter(void) {
- if (img_.dptr_ != NULL) delete []img_.dptr_;
+ if (img_.dptr_ != nullptr) delete []img_.dptr_;
}
// intialize iterator loads data in
virtual void Init(const std::vector<std::pair<std::string, std::string> >&
kwargs) {
diff --git a/src/ndarray/ndarray.cc b/src/ndarray/ndarray.cc
index ddffa28cfd3..b443d5d318c 100644
--- a/src/ndarray/ndarray.cc
+++ b/src/ndarray/ndarray.cc
@@ -2046,7 +2046,7 @@ void Imdecode(NDArray *ret, NDArray mean, size_t index,
#if MXNET_USE_OPENCV
cv::Mat buf(1, size, CV_8U, str_img);
cv::Mat res = cv::imdecode(buf, n_channels == 1 ? 0 : -1);
- CHECK(res.data != NULL) << "OpenCV Failed to decode image";
+ CHECK(res.data != nullptr) << "OpenCV Failed to decode image";
CHECK_LE(n_channels, static_cast<size_t>(res.channels()));
if (y1 - y0 == 0) {
x0 = 0;
diff --git a/src/operator/bilinear_sampler.cc b/src/operator/bilinear_sampler.cc
index a3b7d576424..c435fdeca48 100644
--- a/src/operator/bilinear_sampler.cc
+++ b/src/operator/bilinear_sampler.cc
@@ -163,7 +163,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<cpu>(BilinearSamplerParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new BilinearSamplerOp<cpu, DType>(param);
})
diff --git a/src/operator/contrib/count_sketch.cc
b/src/operator/contrib/count_sketch.cc
index 12814116bbf..ca239b63246 100644
--- a/src/operator/contrib/count_sketch.cc
+++ b/src/operator/contrib/count_sketch.cc
@@ -30,7 +30,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(CountSketchParam param, int dtype) {
LOG(FATAL) << "CountSketch is only available for GPU.";
- return NULL;
+ return nullptr;
}
Operator *CountSketchProp::CreateOperatorEx(Context ctx, std::vector<TShape>
*in_shape,
std::vector<int> *in_type) const {
diff --git a/src/operator/contrib/deformable_convolution.cc
b/src/operator/contrib/deformable_convolution.cc
index 352baa12fbc..78a7a1250d3 100644
--- a/src/operator/contrib/deformable_convolution.cc
+++ b/src/operator/contrib/deformable_convolution.cc
@@ -36,7 +36,7 @@ Operator* CreateOp<cpu>(DeformableConvolutionParam param, int
dtype,
std::vector<TShape> *in_shape,
std::vector<TShape> *out_shape,
Context ctx) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new DeformableConvolutionOp<cpu, DType>(param);
})
diff --git a/src/operator/contrib/deformable_psroi_pooling.cc
b/src/operator/contrib/deformable_psroi_pooling.cc
index 42cf6f19df3..6aaf607f059 100644
--- a/src/operator/contrib/deformable_psroi_pooling.cc
+++ b/src/operator/contrib/deformable_psroi_pooling.cc
@@ -81,7 +81,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(DeformablePSROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new DeformablePSROIPoolingOp<cpu, DType>(param);
});
diff --git a/src/operator/contrib/deformable_psroi_pooling.cu
b/src/operator/contrib/deformable_psroi_pooling.cu
index 71bbd4cd7f2..bf7d1c0bc75 100644
--- a/src/operator/contrib/deformable_psroi_pooling.cu
+++ b/src/operator/contrib/deformable_psroi_pooling.cu
@@ -423,7 +423,7 @@ namespace op {
template<>
Operator* CreateOp<gpu>(DeformablePSROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new DeformablePSROIPoolingOp<gpu, DType>(param);
});
diff --git a/src/operator/contrib/fft.cc b/src/operator/contrib/fft.cc
index 8332451bf92..4a4395836e3 100644
--- a/src/operator/contrib/fft.cc
+++ b/src/operator/contrib/fft.cc
@@ -30,7 +30,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(FFTParam param, int dtype) {
LOG(FATAL) << "fft is only available for GPU.";
- return NULL;
+ return nullptr;
}
Operator *FFTProp::CreateOperatorEx(Context ctx, std::vector<TShape> *in_shape,
diff --git a/src/operator/contrib/ifft.cc b/src/operator/contrib/ifft.cc
index 26e7041ce02..cb4605d8b78 100644
--- a/src/operator/contrib/ifft.cc
+++ b/src/operator/contrib/ifft.cc
@@ -31,7 +31,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(IFFTParam param, int dtype) {
LOG(FATAL) << "ifft is only available for GPU.";
- return NULL;
+ return nullptr;
}
Operator *IFFTProp::CreateOperatorEx(Context ctx, std::vector<TShape>
*in_shape,
diff --git a/src/operator/contrib/multibox_detection.cc
b/src/operator/contrib/multibox_detection.cc
index f92460e9e5e..c005dfa0659 100644
--- a/src/operator/contrib/multibox_detection.cc
+++ b/src/operator/contrib/multibox_detection.cc
@@ -198,7 +198,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(MultiBoxDetectionParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new MultiBoxDetectionOp<cpu, DType>(param);
});
diff --git a/src/operator/contrib/multibox_prior.cc
b/src/operator/contrib/multibox_prior.cc
index 22a9c10cd95..579ea608aa9 100644
--- a/src/operator/contrib/multibox_prior.cc
+++ b/src/operator/contrib/multibox_prior.cc
@@ -76,7 +76,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<cpu>(MultiBoxPriorParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new MultiBoxPriorOp<cpu, DType>(param);
});
diff --git a/src/operator/contrib/multibox_target.cc
b/src/operator/contrib/multibox_target.cc
index 2fa041dd34c..093234b59ec 100644
--- a/src/operator/contrib/multibox_target.cc
+++ b/src/operator/contrib/multibox_target.cc
@@ -284,7 +284,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(MultiBoxTargetParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new MultiBoxTargetOp<cpu, DType>(param);
});
diff --git a/src/operator/contrib/psroi_pooling.cc
b/src/operator/contrib/psroi_pooling.cc
index 75b533446b8..d3a3871ed00 100644
--- a/src/operator/contrib/psroi_pooling.cc
+++ b/src/operator/contrib/psroi_pooling.cc
@@ -66,7 +66,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(PSROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new PSROIPoolingOp<cpu, DType>(param);
});
diff --git a/src/operator/contrib/psroi_pooling.cu
b/src/operator/contrib/psroi_pooling.cu
index 47213163746..e4de9248dfb 100644
--- a/src/operator/contrib/psroi_pooling.cu
+++ b/src/operator/contrib/psroi_pooling.cu
@@ -268,7 +268,7 @@ namespace op {
template<>
Operator* CreateOp<gpu>(PSROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new PSROIPoolingOp<gpu, DType>(param);
});
diff --git a/src/operator/convolution_v1.cc b/src/operator/convolution_v1.cc
index 86c0fbb3329..b6250a7a77f 100644
--- a/src/operator/convolution_v1.cc
+++ b/src/operator/convolution_v1.cc
@@ -38,7 +38,7 @@ Operator* CreateOp<cpu>(ConvolutionV1Param param, int dtype,
std::vector<TShape> *in_shape,
std::vector<TShape> *out_shape,
Context ctx) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new ConvolutionV1Op<cpu, DType>(param);
})
diff --git a/src/operator/correlation.cc b/src/operator/correlation.cc
index fe89e8462d1..d0c664ad4f9 100644
--- a/src/operator/correlation.cc
+++ b/src/operator/correlation.cc
@@ -149,7 +149,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(CorrelationParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new CorrelationOp<cpu, DType>(param);
});
diff --git a/src/operator/correlation.cu b/src/operator/correlation.cu
index 6bc16cde509..821b9007a8f 100644
--- a/src/operator/correlation.cu
+++ b/src/operator/correlation.cu
@@ -622,7 +622,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<gpu>(CorrelationParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new CorrelationOp<gpu, DType>(param);
});
diff --git a/src/operator/custom/custom.cc b/src/operator/custom/custom.cc
index d117a284216..4cda1375fd2 100644
--- a/src/operator/custom/custom.cc
+++ b/src/operator/custom/custom.cc
@@ -75,12 +75,12 @@ inline void AllocateNDArrayCopy(NDArray** nd,
template<CustomOpPropCallbacks Type>
std::vector<std::string> List(const NodeAttrs& attrs) {
const CustomParam& params = nnvm::get<CustomParam>(attrs.parsed);
- char ** args = NULL;
+ char ** args = nullptr;
CHECK(reinterpret_cast<CustomOpListFunc>(
params.info->callbacks[Type])(
&args, params.info->contexts[Type]));
std::vector<std::string> ret;
- for (int i = 0; args[i] != NULL; ++i) {
+ for (int i = 0; args[i] != nullptr; ++i) {
ret.push_back(args[i]);
}
return ret;
diff --git a/src/operator/grid_generator.cc b/src/operator/grid_generator.cc
index ea6e66145c4..96ec5d5a7e7 100644
--- a/src/operator/grid_generator.cc
+++ b/src/operator/grid_generator.cc
@@ -30,7 +30,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<cpu>(GridGeneratorParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
if (dtype == mshadow::kFloat32) {
op = new GridGeneratorOp<cpu, float>(param);
} else {
diff --git a/src/operator/l2_normalization.cc b/src/operator/l2_normalization.cc
index c313b442442..f2f485ae6d1 100644
--- a/src/operator/l2_normalization.cc
+++ b/src/operator/l2_normalization.cc
@@ -27,7 +27,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<cpu>(L2NormalizationParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new L2NormalizationOp<cpu, DType>(param);
});
diff --git a/src/operator/l2_normalization.cu b/src/operator/l2_normalization.cu
index 2034f984174..e5157811d89 100644
--- a/src/operator/l2_normalization.cu
+++ b/src/operator/l2_normalization.cu
@@ -27,7 +27,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<gpu>(L2NormalizationParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new L2NormalizationOp<gpu, DType>(param);
});
diff --git a/src/operator/leaky_relu.cc b/src/operator/leaky_relu.cc
index 4bb24237b8e..45f9511c908 100644
--- a/src/operator/leaky_relu.cc
+++ b/src/operator/leaky_relu.cc
@@ -31,7 +31,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(LeakyReLUParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new LeakyReLUOp<cpu, DType>(param);
});
diff --git a/src/operator/leaky_relu.cu b/src/operator/leaky_relu.cu
index 74b444d8759..a2e0e959a15 100644
--- a/src/operator/leaky_relu.cu
+++ b/src/operator/leaky_relu.cu
@@ -30,7 +30,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<gpu>(LeakyReLUParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new LeakyReLUOp<gpu, DType>(param);
});
diff --git a/src/operator/make_loss.cc b/src/operator/make_loss.cc
index 14304d3cc26..7e45f4ce4ff 100644
--- a/src/operator/make_loss.cc
+++ b/src/operator/make_loss.cc
@@ -28,7 +28,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(MakeLossParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new MakeLossOp<cpu, DType>(param);
});
diff --git a/src/operator/pad.cc b/src/operator/pad.cc
index 2332c93b8d5..6c66b29082c 100644
--- a/src/operator/pad.cc
+++ b/src/operator/pad.cc
@@ -668,7 +668,7 @@ namespace mxnet {
namespace op {
template <>
Operator *CreateOp<cpu>(PadParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, { op = new PadOp<cpu, DType>(param);
})
return op;
}
diff --git a/src/operator/pooling_v1.cc b/src/operator/pooling_v1.cc
index 5b68a08db60..afb51d762dd 100644
--- a/src/operator/pooling_v1.cc
+++ b/src/operator/pooling_v1.cc
@@ -30,7 +30,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(PoolingV1Param param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
switch (param.pool_type) {
case pool_v1_enum::kMaxPooling:
@@ -44,7 +44,7 @@ Operator *CreateOp<cpu>(PoolingV1Param param, int dtype) {
break;
default:
LOG(FATAL) << "unknown pooling type";
- return NULL;
+ return nullptr;
}
})
diff --git a/src/operator/rnn.cc b/src/operator/rnn.cc
index 73ef4f0f42a..9ba764904e1 100644
--- a/src/operator/rnn.cc
+++ b/src/operator/rnn.cc
@@ -29,7 +29,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(RNNParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new RNNOp<DType>(param);
});
diff --git a/src/operator/roi_pooling.cc b/src/operator/roi_pooling.cc
index 124d811c46a..7f15dcb406d 100644
--- a/src/operator/roi_pooling.cc
+++ b/src/operator/roi_pooling.cc
@@ -234,7 +234,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(ROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new ROIPoolingOp<cpu, DType>(param);
});
diff --git a/src/operator/roi_pooling.cu b/src/operator/roi_pooling.cu
index 066c2ffd063..9ea99b309aa 100644
--- a/src/operator/roi_pooling.cu
+++ b/src/operator/roi_pooling.cu
@@ -264,7 +264,7 @@ namespace op {
template<>
Operator* CreateOp<gpu>(ROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new ROIPoolingOp<gpu, DType>(param);
});
diff --git a/src/operator/sequence_last.cc b/src/operator/sequence_last.cc
index f87400b21f9..345524b3813 100644
--- a/src/operator/sequence_last.cc
+++ b/src/operator/sequence_last.cc
@@ -29,7 +29,7 @@ namespace mxnet {
namespace op {
template <>
Operator *CreateOp<cpu>(SequenceLastParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_TYPE_SWITCH(dtype, DType,
{ op = new SequenceLastOp<cpu, DType>(param); })
return op;
diff --git a/src/operator/sequence_mask.cc b/src/operator/sequence_mask.cc
index 047634cc7bc..e02c57bfd91 100644
--- a/src/operator/sequence_mask.cc
+++ b/src/operator/sequence_mask.cc
@@ -29,7 +29,7 @@ namespace mxnet {
namespace op {
template <>
Operator *CreateOp<cpu>(SequenceMaskParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_TYPE_SWITCH(dtype, DType,
{ op = new SequenceMaskOp<cpu, DType>(param); })
return op;
diff --git a/src/operator/sequence_reverse.cc b/src/operator/sequence_reverse.cc
index 834e4f401ed..21cab789110 100644
--- a/src/operator/sequence_reverse.cc
+++ b/src/operator/sequence_reverse.cc
@@ -29,7 +29,7 @@ namespace mxnet {
namespace op {
template <>
Operator *CreateOp<cpu>(SequenceReverseParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_TYPE_SWITCH(dtype, DType,
{ op = new SequenceReverseOp<cpu, DType>(param); })
return op;
diff --git a/src/operator/sequence_reverse.cu b/src/operator/sequence_reverse.cu
index 9c1574814a1..1edc9c13d49 100644
--- a/src/operator/sequence_reverse.cu
+++ b/src/operator/sequence_reverse.cu
@@ -29,7 +29,7 @@
namespace mxnet {
namespace op {
template <> Operator *CreateOp<gpu>(SequenceReverseParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_TYPE_SWITCH(dtype, DType, {
op = new SequenceReverseOp<gpu, DType>(param);
})
diff --git a/src/operator/softmax_output.cc b/src/operator/softmax_output.cc
index 27b3295654b..5ba421fd195 100644
--- a/src/operator/softmax_output.cc
+++ b/src/operator/softmax_output.cc
@@ -29,7 +29,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(SoftmaxOutputParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new SoftmaxOutputOp<cpu, DType>(param);
})
diff --git a/src/operator/spatial_transformer.cc
b/src/operator/spatial_transformer.cc
index 8c6779df1b7..2dcb427ef03 100644
--- a/src/operator/spatial_transformer.cc
+++ b/src/operator/spatial_transformer.cc
@@ -153,7 +153,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<cpu>(SpatialTransformerParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new SpatialTransformerOp<cpu, DType>(param);
})
diff --git a/src/operator/svm_output.cc b/src/operator/svm_output.cc
index c84c2af2848..a291f729870 100644
--- a/src/operator/svm_output.cc
+++ b/src/operator/svm_output.cc
@@ -71,7 +71,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(SVMOutputParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new SVMOutputOp<cpu, DType>(param);
})
diff --git a/src/operator/swapaxis.cc b/src/operator/swapaxis.cc
index 12bc52e1f6f..b78062fde8b 100644
--- a/src/operator/swapaxis.cc
+++ b/src/operator/swapaxis.cc
@@ -31,7 +31,7 @@ namespace op {
template<>
Operator* CreateOp<cpu>(SwapAxisParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_TYPE_SWITCH(dtype, DType, {
op = new SwapAxisOp<cpu, DType>(param);
});
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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