Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
[MXNET-860] Update to modern nullptr usage
Browse files Browse the repository at this point in the history
  • Loading branch information
KellenSunderland committed Aug 25, 2018
1 parent 4c48a97 commit 1f8aeb8
Show file tree
Hide file tree
Showing 34 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/c_api/c_api_executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/c_api/c_predict_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ int MXPredCreate(const char* symbol_json_str,
input_shape_indptr,
input_shape_data,
0,
NULL,
nullptr,
out);
}
namespace mxnet {
Expand Down
2 changes: 1 addition & 1 deletion src/operator/bilinear_sampler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,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);
})
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/count_sketch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/deformable_convolution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/deformable_psroi_pooling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/deformable_psroi_pooling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/fft.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/ifft.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/multibox_detection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/multibox_prior.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/multibox_target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/psroi_pooling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/contrib/psroi_pooling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/convolution_v1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand Down
2 changes: 1 addition & 1 deletion src/operator/correlation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/correlation.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/grid_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/operator/l2_normalization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/l2_normalization.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/leaky_relu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/leaky_relu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/make_loss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
4 changes: 2 additions & 2 deletions src/operator/pooling_v1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -44,7 +44,7 @@ Operator *CreateOp<cpu>(PoolingV1Param param, int dtype) {
break;
default:
LOG(FATAL) << "unknown pooling type";
return NULL;
return nullptr;
}
})

Expand Down
2 changes: 1 addition & 1 deletion src/operator/rnn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/roi_pooling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/roi_pooling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/operator/sequence_last.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/operator/sequence_mask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/operator/sequence_reverse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/operator/softmax_output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand Down
2 changes: 1 addition & 1 deletion src/operator/spatial_transformer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand Down
2 changes: 1 addition & 1 deletion src/operator/svm_output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand Down
2 changes: 1 addition & 1 deletion src/operator/swapaxis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 1f8aeb8

Please sign in to comment.