Exemplo n.º 1
0
 def test_bias_invalid_shape(self):
     x1 = chainer.Variable(numpy.zeros((3, 2, 3), numpy.float32))
     x2 = chainer.Variable(numpy.zeros((2), numpy.float32))
     axis = 0
     with chainer.DebugMode(True):
         with self.assertRaises(AssertionError):
             functions.bias(x1, x2, axis)
Exemplo n.º 2
0
 def test_bias_invalid_argc2(self):
     func = links.Bias(self.axis, None)
     with chainer.DebugMode(True):
         with self.assertRaises(AssertionError):
             func(self.x)
Exemplo n.º 3
0
 def test_bias_invalid_argc1(self):
     func = links.Bias(self.axis, self.b.data.shape)
     with chainer.DebugMode(True):
         with self.assertRaises(AssertionError):
             func(self.x, self.b)
Exemplo n.º 4
0
 def test_scale_invalid_argc1(self):
     func = links.Scale(self.axis, self.W.data.shape)
     with chainer.DebugMode(True):
         with self.assertRaises(AssertionError):
             func(self.x, self.W)