コード例 #1
0
 def test_output_size():
     # im_h * im_w must be L
     x = paddle.randn(shape=[2, 6, 6], dtype="float32")
     out = fold(x,
                output_sizes=[6, 6],
                kernel_sizes=[2, 2],
                strides=[1, 1])
コード例 #2
0
 def test_block_h_w():
     # test_block_h_w GT 0
     x = paddle.randn(shape=[2, 1, 1], dtype="float32")
     out = fold(x,
                output_sizes=[1, 1],
                kernel_sizes=[2, 2],
                strides=1)
コード例 #3
0
 def test_strides_shape():
     # strids_size must be 2
     x = paddle.randn(shape=[2, 6, 6], dtype="float32")
     out = fold(x,
                output_sizes=[2, 3],
                kernel_sizes=[2, 2],
                strides=[2, 2, 3])
コード例 #4
0
 def test_dilations_shape():
     # dialtions_size must be 2
     x = paddle.randn(shape=[2, 6, 6], dtype="float32")
     out = fold(x,
                output_sizes=[2, 3],
                kernel_sizes=[2, 2],
                dilations=[2, 2, 3])
コード例 #5
0
 def test_padding_shape():
     # padding_size must be 2 or 4
     x = paddle.randn(shape=[2, 6, 6], dtype="float32")
     out = fold(x,
                output_sizes=[2, 3],
                kernel_sizes=[2, 2],
                paddings=[2, 2, 3])
コード例 #6
0
ファイル: test_fold_op.py プロジェクト: sandyhouse/Paddle
 def test_output_size_2():
     # out_size must GT 1
     x = paddle.randn(shape=[2, 6, 6], dtype="float32")
     out = fold(x,
                output_sizes=[0.1, 0.2],
                kernel_sizes=[2, 2],
                strides=[1, 1])
コード例 #7
0
 def test_GT_0():
     x = paddle.randn(shape=[2, 1, 1], dtype="float32")
     out = fold(x,
                output_sizes=[0, 0],
                kernel_sizes=[0, 0],
                dilations=0,
                paddings=[0, 0],
                strides=0)
コード例 #8
0
 def test_input_shape():
     # input_shpae must be 3-D
     x = paddle.randn(shape=[2, 3, 6, 7], dtype="float32")
     out = fold(x, output_sizes=[2, 3], kernel_sizes=[2, 2])