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)
def test_bias_invalid_argc2(self): func = links.Bias(self.axis, None) with chainer.DebugMode(True): with self.assertRaises(AssertionError): func(self.x)
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)
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)