提交 fb1d9e09 authored 作者: Frederic's avatar Frederic

use dimensions with different shapes.

上级 c6d9d76f
...@@ -158,28 +158,13 @@ class TestDownsampleFactorMax(utt.InferShapeTester): ...@@ -158,28 +158,13 @@ class TestDownsampleFactorMax(utt.InferShapeTester):
gz = tensor.dtensor4() gz = tensor.dtensor4()
rng = numpy.random.RandomState(utt.fetch_seed()) rng = numpy.random.RandomState(utt.fetch_seed())
maxpoolshps = ((1, 1), (2, 2), (3, 3), (2, 3), (3, 2)) maxpoolshps = ((1, 1), (2, 2), (3, 3), (2, 3), (3, 2))
image_val = rng.rand(2, 3, 3, 4)
out_shapes = [[[2, 3, 3, 4], [2, 3, 3, 4]],
[[2, 3, 1, 2], [2, 3, 2, 2]],
[[2, 3, 1, 1], [2, 3, 1, 2]],
[[2, 3, 1, 1], [2, 3, 2, 2]],
[[2, 3, 1, 2], [2, 3, 1, 2]]]
"""
image_val = rng.rand(4, 6, 7, 9) image_val = rng.rand(4, 6, 7, 9)
out_shapes = [[[4, 6, 7, 9], [4, 6, 7, 9]], out_shapes = [[[4, 6, 7, 9], [4, 6, 7, 9]],
[[4, 6, 3, 4], [4, 6, 4, 5]], [[4, 6, 3, 4], [4, 6, 4, 5]],
[[4, 6, 2, 3], [4, 6, 3, 3]], [[4, 6, 2, 3], [4, 6, 3, 3]],
[[4, 6, 3, 3], [4, 6, 4, 3]], [[4, 6, 3, 3], [4, 6, 4, 3]],
[[4, 6, 2, 4], [4, 6, 3, 5]]] [[4, 6, 2, 4], [4, 6, 3, 5]]]
image_val = rng.rand(4, 10, 64, 64)
out_shapes = [[[4, 10, 64, 64], [4, 10, 64, 64]],
[[4, 10, 32, 32], [4, 10, 32, 32]],
[[4, 10, 21, 21], [4, 10, 22, 22]],
[[4, 10, 32, 21], [4, 10, 32, 22]],
[[4, 10, 21, 32], [4, 10, 22, 32]]]
"""
for i, maxpoolshp in enumerate(maxpoolshps): for i, maxpoolshp in enumerate(maxpoolshps):
for j, ignore_border in enumerate([True, False]): for j, ignore_border in enumerate([True, False]):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论