提交 56b966a1 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Cast value into floatX when input is vector/matrix

上级 18592e73
......@@ -3990,19 +3990,19 @@ def test_tile():
rng = numpy.random.RandomState(utt.fetch_seed())
x = vector()
f = function([x], tile(x, (2,)))
x_ = rng.randn(5)
x_ = rng.randn(5).astype(config.floatX)
assert numpy.all(f(x_) == numpy.tile(x_, (2,)))
# Test the two-dimensional case.
x = matrix()
f = function([x], tile(x, (2, 3)))
x_ = rng.randn(2, 4)
x_ = rng.randn(2, 4).astype(config.floatX)
assert numpy.all(f(x_) == numpy.tile(x_, (2, 3)))
# Test the three-dimensional case.
x = tensor3()
f = function([x], tile(x, (2, 3, 4)))
x_ = rng.randn(2, 4, 3)
x_ = rng.randn(2, 4, 3).astype(config.floatX)
assert numpy.all(f(x_) == numpy.tile(x_, (2, 3, 4)))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论