|
|
|
@ -152,73 +152,6 @@ class TestElementwiseMulMKLDNNOp_Integrated_With_Convs(ElementwiseMulOp):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# TODO(LeoZhao-Intel): re-enable this case
|
|
|
|
|
# https://github.com/PaddlePaddle/Paddle/issues/16764
|
|
|
|
|
@unittest.skip("Not supported well on avx2.")
|
|
|
|
|
class TestElementwiseMulMKLDNNOp_BroadcastNCHW16c(ElementwiseMulOp):
|
|
|
|
|
def init_input_output(self):
|
|
|
|
|
x = np.random.rand(1, 16, 2, 2).astype(self.dtype)
|
|
|
|
|
self.x = x.transpose(0, 2, 3, 1).reshape(1, 16, 2, 2)
|
|
|
|
|
self.y = np.random.rand(1, 16).astype(self.dtype)
|
|
|
|
|
|
|
|
|
|
self.out = x * self.y.reshape(1, 16, 1, 1)
|
|
|
|
|
self.out = self.out.transpose(0, 2, 3, 1).reshape(1, 16, 2, 2)
|
|
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
|
super(TestElementwiseMulMKLDNNOp_BroadcastNCHW16c, self).setUp()
|
|
|
|
|
self.attrs["x_data_format"] = "nchw16c"
|
|
|
|
|
self.attrs["y_data_format"] = "nc"
|
|
|
|
|
self._cpu_only = True
|
|
|
|
|
|
|
|
|
|
def init_kernel_type(self):
|
|
|
|
|
self.use_mkldnn = True
|
|
|
|
|
|
|
|
|
|
def init_axis(self):
|
|
|
|
|
self.axis = 0
|
|
|
|
|
|
|
|
|
|
def test_check_grad_normal(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def test_check_grad_ingore_x(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def test_check_grad_ingore_y(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@unittest.skip(
|
|
|
|
|
"Not implemented yet.") # TODO(mgallus): enable when implemented.
|
|
|
|
|
class TestElementwiseMulMKLDNNOp_BroadcastNCHW8c(ElementwiseMulOp):
|
|
|
|
|
def init_input_output(self):
|
|
|
|
|
x = np.random.rand(1, 8, 2, 2).astype(self.dtype)
|
|
|
|
|
self.x = x.transpose(0, 2, 3, 1).reshape(1, 8, 2, 2)
|
|
|
|
|
self.y = np.random.rand(1, 8).astype(self.dtype)
|
|
|
|
|
|
|
|
|
|
self.out = x * self.y.reshape(1, 8, 1, 1)
|
|
|
|
|
self.out = self.out.transpose(0, 2, 3, 1).reshape(1, 8, 2, 2)
|
|
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
|
super(TestElementwiseMulMKLDNNOp_BroadcastNCHW8c, self).setUp()
|
|
|
|
|
self.attrs["x_data_format"] = "nchw8c"
|
|
|
|
|
self.attrs["y_data_format"] = "nc"
|
|
|
|
|
self._cpu_only = True
|
|
|
|
|
|
|
|
|
|
def init_kernel_type(self):
|
|
|
|
|
self.use_mkldnn = True
|
|
|
|
|
|
|
|
|
|
def init_axis(self):
|
|
|
|
|
self.axis = 0
|
|
|
|
|
|
|
|
|
|
def test_check_grad_normal(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def test_check_grad_ingore_x(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def test_check_grad_ingore_y(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestElementwiseMulMKLDNNOp_FallbackNCHW(ElementwiseMulOp):
|
|
|
|
|
def init_input_output(self):
|
|
|
|
|
self.x = np.random.rand(1, 16, 2, 2).astype(self.dtype)
|
|
|
|
|