Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #3
0
 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)