@@ -275,88 +275,87 @@ def config(self):
275275 self .add_value_shape = (10 , 4 )
276276
277277
278- class TestIndexAddAPIError (unittest .TestCase ):
279-
280- def test_errors (self ):
281- paddle .enable_static ()
282- with paddle .static .program_guard (paddle .static .Program (),
283- paddle .static .Program ()):
284-
285- def test_add_value_shape ():
286- axis = 0
287- x = paddle .static .data (name = 'X' ,
288- shape = [10 , 10 ],
289- dtype = "float64" )
290- index = paddle .static .data (name = 'Index' ,
291- shape = [4 ],
292- dtype = "int32" )
293- add_value = paddle .static .data (name = 'AddValue' ,
294- shape = [4 , 3 ],
295- dtype = "float64" )
296- out = paddle .index_add (x , index , axis , add_value )
297-
298- self .assertRaises (ValueError , test_add_value_shape )
299-
300- def test_index_dtype ():
301- axis = 0
302- x = paddle .static .data (name = 'X1' ,
303- shape = [10 , 10 ],
304- dtype = "float64" )
305- index = paddle .static .data (name = 'Index1' ,
306- shape = [4 ],
307- dtype = "float32" )
308- add_value = paddle .static .data (name = 'AddValue1' ,
309- shape = [4 , 10 ],
310- dtype = "float64" )
311- out = paddle .index_add (x , index , axis , add_value )
312-
313- self .assertRaises (TypeError , test_index_dtype )
314-
315- def test_index_shape ():
316- axis = 0
317- x = paddle .static .data (name = 'X2' ,
318- shape = [10 , 10 ],
319- dtype = "float64" )
320- index = paddle .static .data (name = 'Index2' ,
321- shape = [4 , 3 ],
322- dtype = "int32" )
323- add_value = paddle .static .data (name = 'AddValue2' ,
324- shape = [4 , 10 ],
325- dtype = "float64" )
326- out = paddle .index_add (x , index , axis , add_value )
327-
328- self .assertRaises (ValueError , test_index_shape )
329-
330- def test_axis_value ():
331- axis = 3
332- x = paddle .static .data (name = 'X3' ,
333- shape = [10 , 10 ],
334- dtype = "float64" )
335- index = paddle .static .data (name = 'Index3' ,
336- shape = [4 ],
337- dtype = "int32" )
338- add_value = paddle .static .data (name = 'AddValue3' ,
339- shape = [4 , 10 ],
340- dtype = "float64" )
341- out = paddle .index_add (x , index , axis , add_value )
342-
343- self .assertRaises (ValueError , test_axis_value )
344-
345- def test_add_value_broadcast ():
346- axis = 0
347- x = paddle .static .data (name = 'X4' ,
348- shape = [10 , 10 ],
349- dtype = "float64" )
350- index = paddle .static .data (name = 'Index4' ,
351- shape = [4 ],
352- dtype = "int32" )
353- add_value = paddle .static .data (name = 'AddValue4' ,
354- shape = [4 ],
355- dtype = "float64" )
356- out = paddle .index_add (x , index , axis , add_value )
357-
358- self .assertRaises (ValueError , test_add_value_broadcast )
359-
278+ # class TestIndexAddAPIError(unittest.TestCase):
279+
280+ # def test_errors(self):
281+ # paddle.enable_static()
282+ # with paddle.static.program_guard(paddle.static.Program(),
283+ # paddle.static.Program()):
284+
285+ # def test_add_value_shape():
286+ # axis = 0
287+ # x = paddle.static.data(name='X',
288+ # shape=[10, 10],
289+ # dtype="float64")
290+ # index = paddle.static.data(name='Index',
291+ # shape=[4],
292+ # dtype="int32")
293+ # add_value = paddle.static.data(name='AddValue',
294+ # shape=[4, 3],
295+ # dtype="float64")
296+ # out = paddle.index_add(x, index, axis, add_value)
297+
298+ # self.assertRaises(ValueError, test_add_value_shape)
299+
300+ # def test_index_dtype():
301+ # axis = 0
302+ # x = paddle.static.data(name='X1',
303+ # shape=[10, 10],
304+ # dtype="float64")
305+ # index = paddle.static.data(name='Index1',
306+ # shape=[4],
307+ # dtype="float32")
308+ # add_value = paddle.static.data(name='AddValue1',
309+ # shape=[4, 10],
310+ # dtype="float64")
311+ # out = paddle.index_add(x, index, axis, add_value)
312+
313+ # self.assertRaises(TypeError, test_index_dtype)
314+
315+ # def test_index_shape():
316+ # axis = 0
317+ # x = paddle.static.data(name='X2',
318+ # shape=[10, 10],
319+ # dtype="float64")
320+ # index = paddle.static.data(name='Index2',
321+ # shape=[4, 3],
322+ # dtype="int32")
323+ # add_value = paddle.static.data(name='AddValue2',
324+ # shape=[4, 10],
325+ # dtype="float64")
326+ # out = paddle.index_add(x, index, axis, add_value)
327+
328+ # self.assertRaises(ValueError, test_index_shape)
329+
330+ # def test_axis_value():
331+ # axis = 3
332+ # x = paddle.static.data(name='X3',
333+ # shape=[10, 10],
334+ # dtype="float64")
335+ # index = paddle.static.data(name='Index3',
336+ # shape=[4],
337+ # dtype="int32")
338+ # add_value = paddle.static.data(name='AddValue3',
339+ # shape=[4, 10],
340+ # dtype="float64")
341+ # out = paddle.index_add(x, index, axis, add_value)
342+
343+ # self.assertRaises(ValueError, test_axis_value)
344+
345+ # def test_add_value_broadcast():
346+ # axis = 0
347+ # x = paddle.static.data(name='X4',
348+ # shape=[10, 10],
349+ # dtype="float64")
350+ # index = paddle.static.data(name='Index4',
351+ # shape=[4],
352+ # dtype="int32")
353+ # add_value = paddle.static.data(name='AddValue4',
354+ # shape=[4],
355+ # dtype="float64")
356+ # out = paddle.index_add(x, index, axis, add_value)
357+
358+ # self.assertRaises(ValueError, test_add_value_broadcast)
360359
361360if __name__ == '__main__' :
362361 unittest .main ()
0 commit comments