提交 4a6512b1 authored 作者: Taesup (TS) Kim's avatar Taesup (TS) Kim

Add new test lines

上级 94a23780
......@@ -687,6 +687,24 @@ class TestBilinearUpsampling(unittest.TestCase):
up_mat_2d = self.get_upsampled_twobytwo_mat(input_x, ratio)
utt.assert_allclose(f(), up_mat_2d, rtol=1e-06)
def test_bilinear_upsampling_reshaping(self):
"""Test bilinear upsampling without giving shape information
This method tests the bilinear_upsampling method
without giving batch_size and num_input_channels
"""
# upsampling for a ratio of two
input_x = np.array([[[[1, 2], [3, 4]]]], dtype=theano.config.floatX)
for ratio in [2, 3]:
for use_1D_kernel in [True, False]:
bilin_mat = bilinear_upsampling(input=input_x, ratio=ratio,
use_1D_kernel=use_1D_kernel)
f = theano.function([], bilin_mat, mode=self.compile_mode)
up_mat_2d = self.get_upsampled_twobytwo_mat(input_x, ratio)
utt.assert_allclose(f(), up_mat_2d, rtol=1e-06)
def test_compare_1D_and_2D_upsampling_values(self):
"""Compare 1D and 2D upsampling
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论