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

[Fix Bug] set upper bound infinity for conv, resize, upsampling, etc. #18857

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/operator/contrib/bilinear_resize-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ struct BilinearSampleParam : public dmlc::Parameter<BilinearSampleParam> {
int mode;
bool align_corners;
DMLC_DECLARE_PARAMETER(BilinearSampleParam) {
DMLC_DECLARE_FIELD(height).set_default(1).set_range(1, 10000)
DMLC_DECLARE_FIELD(height).set_default(1).set_lower_bound(1)
.describe("output height (required, but ignored if scale_height is defined or mode is not "
"\"size\")");
DMLC_DECLARE_FIELD(width).set_default(1).set_range(1, 10000)
DMLC_DECLARE_FIELD(width).set_default(1).set_lower_bound(1)
.describe("output width (required, but ignored if scale_width is defined or mode is not "
"\"size\")");
DMLC_DECLARE_FIELD(scale_height).set_default(dmlc::optional<float>())
Expand Down
4 changes: 2 additions & 2 deletions src/operator/contrib/deformable_convolution-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ struct DeformableConvolutionParam : public dmlc::Parameter<DeformableConvolution
.describe("Convolution dilate: (h, w) or (d, h, w). Defaults to 1 for each dimension.");
DMLC_DECLARE_FIELD(pad).set_default(mxnet::TShape(0, -1))
.describe("Zero pad for convolution: (h, w) or (d, h, w). Defaults to no padding.");
DMLC_DECLARE_FIELD(num_filter).set_range(1, 100000)
DMLC_DECLARE_FIELD(num_filter).set_lower_bound(1)
.describe("Convolution filter(channel) number");
DMLC_DECLARE_FIELD(num_group).set_default(1)
.describe("Number of group partitions.");
DMLC_DECLARE_FIELD(num_deformable_group).set_default(1)
.describe("Number of deformable group partitions.");
DMLC_DECLARE_FIELD(workspace).set_default(1024).set_range(0, 8192)
DMLC_DECLARE_FIELD(workspace).set_default(1024).set_lower_bound(0)
.describe("Maximum temperal workspace allowed for convolution (MB).");
DMLC_DECLARE_FIELD(no_bias).set_default(false)
.describe("Whether to disable bias parameter.");
Expand Down
4 changes: 2 additions & 2 deletions src/operator/contrib/modulated_deformable_convolution-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ struct ModulatedDeformableConvolutionParam
.describe("Convolution dilate: (h, w) or (d, h, w). Defaults to 1 for each dimension.");
DMLC_DECLARE_FIELD(pad).set_default(mxnet::TShape(0, -1))
.describe("Zero pad for convolution: (h, w) or (d, h, w). Defaults to no padding.");
DMLC_DECLARE_FIELD(num_filter).set_range(1, 100000)
DMLC_DECLARE_FIELD(num_filter).set_lower_bound(1)
.describe("Convolution filter(channel) number");
DMLC_DECLARE_FIELD(num_group).set_default(1)
.describe("Number of group partitions.");
DMLC_DECLARE_FIELD(num_deformable_group).set_default(1)
.describe("Number of deformable group partitions.");
DMLC_DECLARE_FIELD(workspace).set_default(1024).set_range(0, 8192)
DMLC_DECLARE_FIELD(workspace).set_default(1024).set_lower_bound(0)
.describe("Maximum temperal workspace allowed for convolution (MB).");
DMLC_DECLARE_FIELD(no_bias).set_default(false)
.describe("Whether to disable bias parameter.");
Expand Down
4 changes: 2 additions & 2 deletions src/operator/convolution_v1-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ struct ConvolutionV1Param : public dmlc::Parameter<ConvolutionV1Param> {
.describe("convolution dilate: (h, w) or (d, h, w)");
DMLC_DECLARE_FIELD(pad).set_default(mxnet::TShape(0, 0))
.describe("pad for convolution: (h, w) or (d, h, w)");
DMLC_DECLARE_FIELD(num_filter).set_range(1, 100000)
DMLC_DECLARE_FIELD(num_filter).set_lower_bound(1)
.describe("convolution filter(channel) number");
DMLC_DECLARE_FIELD(num_group).set_default(1)
.describe("Number of group partitions. Equivalent to slicing input into num_group\n "
"partitions, apply convolution on each, then concatenate the results");
DMLC_DECLARE_FIELD(workspace).set_default(1024).set_range(0, 8192)
DMLC_DECLARE_FIELD(workspace).set_default(1024).set_lower_bound(0)
.describe("Maximum temporary workspace allowed for convolution (MB)."
"This parameter determines the effective batch size of the convolution "
"kernel, which may be smaller than the given batch size. "
Expand Down
4 changes: 2 additions & 2 deletions src/operator/nn/convolution-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ struct ConvolutionParam : public dmlc::Parameter<ConvolutionParam> {
.describe("Convolution dilate: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension.");
DMLC_DECLARE_FIELD(pad).set_default(mxnet::TShape(0, 0))
.describe("Zero pad for convolution: (w,), (h, w) or (d, h, w). Defaults to no padding.");
DMLC_DECLARE_FIELD(num_filter).set_range(1, 100000)
DMLC_DECLARE_FIELD(num_filter).set_lower_bound(1)
.describe("Convolution filter(channel) number");
DMLC_DECLARE_FIELD(num_group).set_default(1)
.describe("Number of group partitions.");
DMLC_DECLARE_FIELD(workspace).set_default(1024).set_range(0, 8192)
DMLC_DECLARE_FIELD(workspace).set_default(1024).set_lower_bound(0)
.describe("Maximum temporary workspace allowed (MB) in convolution."
"This parameter has two usages. When CUDNN is not used, it determines the "
"effective batch size of the convolution kernel. When CUDNN is used, it controls "
Expand Down
4 changes: 2 additions & 2 deletions src/operator/nn/deconvolution-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ struct DeconvolutionParam : public dmlc::Parameter<DeconvolutionParam> {
"`adj` will be ignored and computed accordingly.");
DMLC_DECLARE_FIELD(target_shape).set_default(mxnet::TShape(0, 0))
.describe("Shape of the output tensor: (w,), (h, w) or (d, h, w).");
DMLC_DECLARE_FIELD(num_filter).set_range(1, 100000)
DMLC_DECLARE_FIELD(num_filter).set_lower_bound(1)
.describe("Number of output filters.");
DMLC_DECLARE_FIELD(num_group).set_default(1)
.describe("Number of groups partition.");
DMLC_DECLARE_FIELD(workspace).set_default(512).set_range(0, 8192)
DMLC_DECLARE_FIELD(workspace).set_default(512).set_lower_bound(0)
.describe("Maximum temporary workspace allowed (MB) in deconvolution."
"This parameter has two usages. When CUDNN is not used, it determines the "
"effective batch size of the deconvolution kernel. When CUDNN is used, "
Expand Down
4 changes: 2 additions & 2 deletions src/operator/nn/upsampling-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct UpSamplingParam : public dmlc::Parameter<UpSamplingParam> {
uint64_t workspace;
DMLC_DECLARE_PARAMETER(UpSamplingParam) {
DMLC_DECLARE_FIELD(scale)
.set_range(1, 1000)
.set_lower_bound(1)
.describe("Up sampling scale");
DMLC_DECLARE_FIELD(num_filter)
.describe("Input filter. Only used by bilinear sample_type."
Expand All @@ -79,7 +79,7 @@ struct UpSamplingParam : public dmlc::Parameter<UpSamplingParam> {
"upsampling, this can be 1-N; the size of output will be"
"(scale*h_0,scale*w_0) and all other inputs will be upsampled to the"
"same size. For bilinear upsampling this must be 2; 1 input and 1 weight.");
DMLC_DECLARE_FIELD(workspace).set_default(512).set_range(0, 8192)
DMLC_DECLARE_FIELD(workspace).set_default(512).set_lower_bound(0)
.describe("Tmp workspace for deconvolution (MB)");
}
}; // struct UpSamplingParam
Expand Down