Skip to content

Commit

Permalink
pytorch converter
Browse files Browse the repository at this point in the history
  • Loading branch information
markrogersjr committed Apr 23, 2019
1 parent 5310e8d commit 7cdfc43
Show file tree
Hide file tree
Showing 21 changed files with 2,712 additions and 2 deletions.
39 changes: 39 additions & 0 deletions nnvm/include/nnvm/top/nn.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,45 @@ struct GlobalPool2DParam : public dmlc::Parameter<GlobalPool2DParam> {
}
};


struct AdaptiveMaxPool2DParam : public dmlc::Parameter<AdaptiveMaxPool2DParam> {
int out_height;
int out_width;
std::string layout;

DMLC_DECLARE_PARAMETER(AdaptiveMaxPool2DParam) {
DMLC_DECLARE_FIELD(out_height)
.describe("Output height");
DMLC_DECLARE_FIELD(out_width)
.describe("Output width");
DMLC_DECLARE_FIELD(layout).set_default("NCHW")
.describe("Dimension ordering of data and weight. Can be 'NCHW', 'NHWC', etc."
"'N', 'C', 'H', 'W' stands for batch, channel, height, and width"
"dimensions respectively. Convolution is applied on the 'H' and"
"'W' dimensions.");
}
};


struct AdaptiveAvgPool2DParam : public dmlc::Parameter<AdaptiveAvgPool2DParam> {
int out_height;
int out_width;
std::string layout;

DMLC_DECLARE_PARAMETER(AdaptiveAvgPool2DParam) {
DMLC_DECLARE_FIELD(out_height)
.describe("Output height");
DMLC_DECLARE_FIELD(out_width)
.describe("Output width");
DMLC_DECLARE_FIELD(layout).set_default("NCHW")
.describe("Dimension ordering of data and weight. Can be 'NCHW', 'NHWC', etc."
"'N', 'C', 'H', 'W' stands for batch, channel, height, and width"
"dimensions respectively. Convolution is applied on the 'H' and"
"'W' dimensions.");
}
};


struct UpSamplingParam : public dmlc::Parameter<UpSamplingParam> {
int scale;
std::string layout;
Expand Down
1 change: 1 addition & 0 deletions nnvm/python/nnvm/frontend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from .darknet import from_darknet
from .tensorflow import from_tensorflow
from .caffe2 import from_caffe2
from .pytorch import from_pytorch
2 changes: 2 additions & 0 deletions nnvm/python/nnvm/frontend/pytorch/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
r'''PyTorch->NNVM converter'''
from .converter import from_pytorch
Loading

0 comments on commit 7cdfc43

Please sign in to comment.