Skip to content

Commit

Permalink
pytorch converter
Browse files Browse the repository at this point in the history
  • Loading branch information
markrogersjr committed May 17, 2019
1 parent 13cab06 commit 0b3b7f7
Show file tree
Hide file tree
Showing 16 changed files with 2,610 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 @@ -413,6 +413,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("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("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 0b3b7f7

Please sign in to comment.