Skip to content

Commit

Permalink
add conv3d_trans_cudnn_op unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
chengduoZH committed Nov 13, 2017
1 parent 3a507b4 commit ec70f0b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions paddle/operators/conv_transpose_cudnn_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ class CudnnConv2DTransposeOpMaker : public Conv2DTransposeOpMaker {
}
};

class CudnnConv3DTransposeOpMaker : public Conv3DTransposeOpMaker {
public:
CudnnConv3DTransposeOpMaker(framework::OpProto* proto,
framework::OpAttrChecker* op_checker)
: Conv3DTransposeOpMaker(proto, op_checker) {
AddAttr<std::vector<int>>("dilations", "dilations of convolution operator.")
.SetDefault(std::vector<int>{1, 1, 1});
AddAttr<int>("workspace_size_MB",
"workspace size for cudnn, in MB, "
"workspace is a section of GPU memory which will be "
"allocated/freed each time the operator runs, larger "
"workspace size can increase performance but also requires "
"better hardward. This size should be carefully setted.")
.SetDefault(4096);
}
};

} // namespace operators
} // namespace paddle

Expand Down
6 changes: 6 additions & 0 deletions python/paddle/v2/framework/tests/test_conv3d_transpose_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,11 @@ def init_op_type(self):
self.op_type = "conv3d_transpose"


# ------------ test_cudnn ------------
class TestCudnn(TestConv3dTransposeOp):
def init_op_type(self):
self.op_type = "conv3d_transpose_cudnn"


if __name__ == '__main__':
unittest.main()

0 comments on commit ec70f0b

Please sign in to comment.