Skip to content

Commit

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


struct AdaptiveMaxPool2DParam : public dmlc::Parameter<AdaptiveMaxPool2DParam> {
TShape output_size;
std::string layout;

DMLC_DECLARE_PARAMETER(AdaptiveMaxPool2DParam) {
DMLC_DECLARE_FIELD(output_size)
.describe("Array of output height and 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> {
TShape output_size;
std::string layout;

DMLC_DECLARE_PARAMETER(AdaptiveAvgPool2DParam) {
DMLC_DECLARE_FIELD(output_size)
.describe("Array of output height and 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 58faed8

Please sign in to comment.