def test_invalid_type(self): x = numpy.random.uniform(-1, 1, (2, )).astype(numpy.float32) with self.assertRaises(type_check.InvalidType): functions.Pad(1, mode='constant')(x, x)
def check_backward(self, x_data, g_data): gradient_check.check_backward(functions.Pad(self.pad_width, self.mode), x_data, g_data, **self.check_backward_options)
def check_backward(self, x_data, g_data): gradient_check.check_backward( functions.Pad(self.pad_width, mode=self.mode, constant_values=self.constant_values), x_data, g_data, **self.check_backward_options)