mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
protected legacy_pad_, replace DeleteDropout with is_test=True
This commit is contained in:
parent
3c989347d8
commit
cc46464cf6
|
|
@ -163,7 +163,6 @@ class ConvPoolOpBase : public Operator<Context> {
|
||||||
// exact padding values. This isolates out the padding scheme that are growing
|
// exact padding values. This isolates out the padding scheme that are growing
|
||||||
// unfortunately complex due to implementational differences from different
|
// unfortunately complex due to implementational differences from different
|
||||||
// frameworks.
|
// frameworks.
|
||||||
LegacyPadding legacy_pad_;
|
|
||||||
int pad_;
|
int pad_;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -176,6 +175,7 @@ class ConvPoolOpBase : public Operator<Context> {
|
||||||
int stride_h_;
|
int stride_h_;
|
||||||
int stride_w_;
|
int stride_w_;
|
||||||
StorageOrder order_;
|
StorageOrder order_;
|
||||||
|
LegacyPadding legacy_pad_;
|
||||||
|
|
||||||
inline void ComputeSizeAndPad(
|
inline void ComputeSizeAndPad(
|
||||||
const int in_size, const int stride, const int kernel,
|
const int in_size, const int stride, const int kernel,
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,8 @@ if __name__ == '__main__':
|
||||||
.read()
|
.read()
|
||||||
)
|
)
|
||||||
net, pretrained_params = caffe_translator.TranslateModel(
|
net, pretrained_params = caffe_translator.TranslateModel(
|
||||||
caffenet, caffenet_pretrained
|
caffenet, caffenet_pretrained, is_test=True
|
||||||
)
|
)
|
||||||
caffe_translator.DeleteDropout(net)
|
|
||||||
with open('data/testdata/caffe_translator/'
|
with open('data/testdata/caffe_translator/'
|
||||||
'bvlc_reference_caffenet.translatedmodel',
|
'bvlc_reference_caffenet.translatedmodel',
|
||||||
'w') as fid:
|
'w') as fid:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user