提交 3327aadd authored 作者: Pascal Lamblin's avatar Pascal Lamblin

new test

上级 30116c1e
...@@ -1666,6 +1666,15 @@ class TestAdvancedSubtensor(unittest.TestCase): ...@@ -1666,6 +1666,15 @@ class TestAdvancedSubtensor(unittest.TestCase):
s = slice(1, 3) s = slice(1, 3)
f(s) f(s)
def test_adv_grouped(self):
# Reported in https://github.com/Theano/Theano/issues/6152
rng = np.random.RandomState(utt.fetch_seed())
var = self.shared(rng.rand(3, 63, 4).astype(config.floatX))
idx1 = self.shared(rng.randint(0, 61, size=(5, 4)).astype('int32'))
idx2 = tensor.arange(4)
out = var[:, idx1, idx2]
f = theano.function([], out, mode=self.mode)
def test_grad(self): def test_grad(self):
ones = np.ones((1, 3), dtype=self.dtype) ones = np.ones((1, 3), dtype=self.dtype)
n = self.shared(ones * 5, broadcastable=(True, False)) n = self.shared(ones * 5, broadcastable=(True, False))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论