def check_forward(self, x_data):
        x = chainer.Variable(x_data)
        ys = separate.separate(x, self.axis)

        self.assertIsInstance(ys, tuple)
        self.assertEqual(len(ys), self.shape[self.axis])
        for i in range(self.shape[self.axis]):
            expect = self.x.take(i, axis=self.axis)
            testing.assert_allclose(ys[i].data, expect)
Exemple #2
0
    def check_forward(self, x_data):
        x = chainer.Variable(x_data)
        ys = separate.separate(x, self.axis)

        self.assertIsInstance(ys, tuple)
        self.assertEqual(len(ys), self.shape[self.axis])
        for i in range(self.shape[self.axis]):
            expect = self.x.take(i, axis=self.axis)
            testing.assert_allclose(ys[i].data, expect)
 def f(x):
     return separate.separate(x, self.axis)
Exemple #4
0
 def f(x):
     return separate.separate(x, self.axis)