@@ -106,8 +106,8 @@ def test_check_output(self):
106
106
if self .testcudnn ():
107
107
place = core .CUDAPlace (0 )
108
108
self .check_output_with_place (place , atol = 1e-5 )
109
- else :
110
- self .check_output ( )
109
+ place = core . CPUPlace ()
110
+ self .check_output_with_place ( place , atol = 1e-5 )
111
111
112
112
def test_check_grad (self ):
113
113
if self .dtype == np .float16 :
@@ -119,9 +119,9 @@ def test_check_grad(self):
119
119
set (['Input' , 'Filter' ]),
120
120
'Output' ,
121
121
max_relative_error = 0.02 )
122
- else :
123
- self .check_grad (
124
- set (['Input' , 'Filter' ]), 'Output' , max_relative_error = 0.02 )
122
+ place = core . CPUPlace ()
123
+ self .check_grad_with_place (
124
+ place , set (['Input' , 'Filter' ]), 'Output' , max_relative_error = 0.02 )
125
125
126
126
def test_check_grad_no_filter (self ):
127
127
if self .dtype == np .float16 :
@@ -133,12 +133,12 @@ def test_check_grad_no_filter(self):
133
133
'Output' ,
134
134
max_relative_error = 0.02 ,
135
135
no_grad_set = set (['Filter' ]))
136
- else :
137
- self .check_grad (
138
- ['Input' ],
139
- 'Output' ,
140
- max_relative_error = 0.02 ,
141
- no_grad_set = set (['Filter' ]))
136
+ place = core . CPUPlace ()
137
+ self .check_grad_with_place (
138
+ place , ['Input' ],
139
+ 'Output' ,
140
+ max_relative_error = 0.02 ,
141
+ no_grad_set = set (['Filter' ]))
142
142
143
143
def test_check_grad_no_input (self ):
144
144
if self .dtype == np .float16 :
@@ -150,12 +150,12 @@ def test_check_grad_no_input(self):
150
150
'Output' ,
151
151
max_relative_error = 0.02 ,
152
152
no_grad_set = set (['Input' ]))
153
- else :
154
- self .check_grad (
155
- ['Filter' ],
156
- 'Output' ,
157
- max_relative_error = 0.02 ,
158
- no_grad_set = set (['Input' ]))
153
+ place = core . CPUPlace ()
154
+ self .check_grad_with_place (
155
+ place , ['Filter' ],
156
+ 'Output' ,
157
+ max_relative_error = 0.02 ,
158
+ no_grad_set = set (['Input' ]))
159
159
160
160
def init_test_case (self ):
161
161
self .pad = [0 , 0 ]
0 commit comments