Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ONNX][TOPI][Relay]Support dilations in pooling operators #7928

Merged
24 changes: 24 additions & 0 deletions include/tvm/relay/attrs/nn.h
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ struct MaxPool2DAttrs : public tvm::AttrsNode<MaxPool2DAttrs> {
Array<IndexExpr> pool_size;
Array<IndexExpr> strides;
Array<IndexExpr> padding;
Array<IndexExpr> dilation;
tvm::String layout;
bool ceil_mode;

Expand All @@ -694,6 +695,9 @@ struct MaxPool2DAttrs : public tvm::AttrsNode<MaxPool2DAttrs> {
TVM_ATTR_FIELD(strides)
.set_default(Array<IndexExpr>({1, 1}))
.describe("Specifies the strides of the convolution.");
TVM_ATTR_FIELD(dilation)
.set_default(Array<IndexExpr>({1, 1}))
.describe("Specifies the dilation of the convolution.");
TVM_ATTR_FIELD(padding)
.set_default(Array<IndexExpr>({0, 0}))
.describe(
Expand All @@ -717,6 +721,7 @@ struct AvgPool2DAttrs : public tvm::AttrsNode<AvgPool2DAttrs> {
Array<IndexExpr> pool_size;
Array<IndexExpr> strides;
Array<IndexExpr> padding;
Array<IndexExpr> dilation;
tvm::String layout;
bool ceil_mode;
bool count_include_pad;
Expand All @@ -726,6 +731,9 @@ struct AvgPool2DAttrs : public tvm::AttrsNode<AvgPool2DAttrs> {
TVM_ATTR_FIELD(strides)
.set_default(Array<IndexExpr>({1, 1}))
.describe("Specifies the strides of the convolution.");
TVM_ATTR_FIELD(dilation)
.set_default(Array<IndexExpr>({1, 1}))
.describe("Specifies the dilation of the convolution.");
TVM_ATTR_FIELD(padding)
.set_default(Array<IndexExpr>({0, 0}))
.describe(
Expand Down Expand Up @@ -813,6 +821,7 @@ struct AdaptivePool3DAttrs : public tvm::AttrsNode<AdaptivePool3DAttrs> {
struct MaxPool1DAttrs : public tvm::AttrsNode<MaxPool1DAttrs> {
Array<IndexExpr> pool_size;
Array<IndexExpr> strides;
Array<IndexExpr> dilation;
Array<IndexExpr> padding;
std::string layout;
bool ceil_mode;
Expand All @@ -822,6 +831,9 @@ struct MaxPool1DAttrs : public tvm::AttrsNode<MaxPool1DAttrs> {
TVM_ATTR_FIELD(strides)
.set_default(Array<IndexExpr>({1}))
.describe("Specifies the strides of the convolution.");
TVM_ATTR_FIELD(dilation)
.set_default(Array<IndexExpr>({1}))
.describe("Specifies the dilation of the convolution.");
TVM_ATTR_FIELD(padding)
.set_default(Array<IndexExpr>({0}))
.describe(
Expand All @@ -843,6 +855,7 @@ struct MaxPool1DAttrs : public tvm::AttrsNode<MaxPool1DAttrs> {
struct AvgPool1DAttrs : public tvm::AttrsNode<AvgPool1DAttrs> {
Array<IndexExpr> pool_size;
Array<IndexExpr> strides;
Array<IndexExpr> dilation;
Array<IndexExpr> padding;
std::string layout;
bool ceil_mode;
Expand All @@ -853,6 +866,9 @@ struct AvgPool1DAttrs : public tvm::AttrsNode<AvgPool1DAttrs> {
TVM_ATTR_FIELD(strides)
.set_default(Array<IndexExpr>({1}))
.describe("Specifies the strides of the convolution.");
TVM_ATTR_FIELD(dilation)
.set_default(Array<IndexExpr>({1}))
.describe("Specifies the dilation of the convolution.");
TVM_ATTR_FIELD(padding)
.set_default(Array<IndexExpr>({0}))
.describe(
Expand All @@ -877,6 +893,7 @@ struct AvgPool1DAttrs : public tvm::AttrsNode<AvgPool1DAttrs> {
struct MaxPool3DAttrs : public tvm::AttrsNode<MaxPool3DAttrs> {
Array<IndexExpr> pool_size;
Array<IndexExpr> strides;
Array<IndexExpr> dilation;
Array<IndexExpr> padding;
std::string layout;
bool ceil_mode;
Expand All @@ -886,6 +903,9 @@ struct MaxPool3DAttrs : public tvm::AttrsNode<MaxPool3DAttrs> {
TVM_ATTR_FIELD(strides)
.set_default(Array<IndexExpr>({1, 1, 1}))
.describe("Specifies the strides of the convolution.");
TVM_ATTR_FIELD(dilation)
.set_default(Array<IndexExpr>({1, 1, 1}))
.describe("Specifies the dilation of the convolution.");
TVM_ATTR_FIELD(padding)
.set_default(Array<IndexExpr>({0, 0, 0}))
.describe(
Expand All @@ -908,6 +928,7 @@ struct MaxPool3DAttrs : public tvm::AttrsNode<MaxPool3DAttrs> {
struct AvgPool3DAttrs : public tvm::AttrsNode<AvgPool3DAttrs> {
Array<IndexExpr> pool_size;
Array<IndexExpr> strides;
Array<IndexExpr> dilation;
Array<IndexExpr> padding;
std::string layout;
bool ceil_mode;
Expand All @@ -918,6 +939,9 @@ struct AvgPool3DAttrs : public tvm::AttrsNode<AvgPool3DAttrs> {
TVM_ATTR_FIELD(strides)
.set_default(Array<IndexExpr>({1, 1, 1}))
.describe("Specifies the strides of the convolution.");
TVM_ATTR_FIELD(dilation)
.set_default(Array<IndexExpr>({1, 1, 1}))
.describe("Specifies the dilation of the convolution.");
TVM_ATTR_FIELD(padding)
.set_default(Array<IndexExpr>({0, 0, 0}))
.describe(
Expand Down
Loading