@@ -406,6 +406,118 @@ def forward(self, inputVec, weight):
406
406
def _Convolution2DTF32Module_basic (module , tu : TestUtils ):
407
407
module .forward (torch .randn (3 , 3 , 10 , 10 ), torch .randn (3 , 3 , 2 , 2 ))
408
408
409
+ class _ConvolutionDeprecated2DAllFalseModule (torch .nn .Module ):
410
+ def __init__ (self ):
411
+ super ().__init__ ()
412
+
413
+ @export
414
+ @annotate_args ([
415
+ None ,
416
+ ([- 1 , - 1 , - 1 , - 1 ], torch .float32 , True ),
417
+ ([- 1 , - 1 , - 1 , - 1 ], torch .float32 , True ),
418
+ ])
419
+ def forward (self , inputVec , weight ):
420
+ return torch .ops .aten ._convolution (inputVec ,
421
+ weight ,
422
+ bias = None ,
423
+ stride = [3 , 3 ],
424
+ padding = [2 , 2 ],
425
+ dilation = [1 , 1 ],
426
+ transposed = False ,
427
+ output_padding = [0 , 0 ],
428
+ groups = 1 ,
429
+ benchmark = False ,
430
+ deterministic = False ,
431
+ cudnn_enabled = False )
432
+
433
+ @register_test_case (module_factory = lambda : _ConvolutionDeprecated2DAllFalseModule ())
434
+ def _ConvolutionDeprecated2DAllFalseModule_basic (module , tu : TestUtils ):
435
+ module .forward (torch .randn (3 , 3 , 10 , 10 ), torch .randn (3 , 3 , 2 , 2 ))
436
+
437
+ class _ConvolutionDeprecated2DBenchmarkModule (torch .nn .Module ):
438
+ def __init__ (self ):
439
+ super ().__init__ ()
440
+
441
+ @export
442
+ @annotate_args ([
443
+ None ,
444
+ ([- 1 , - 1 , - 1 , - 1 ], torch .float32 , True ),
445
+ ([- 1 , - 1 , - 1 , - 1 ], torch .float32 , True ),
446
+ ])
447
+ def forward (self , inputVec , weight ):
448
+ return torch .ops .aten ._convolution (inputVec ,
449
+ weight ,
450
+ bias = None ,
451
+ stride = [3 , 3 ],
452
+ padding = [2 , 2 ],
453
+ dilation = [1 , 1 ],
454
+ transposed = False ,
455
+ output_padding = [0 , 0 ],
456
+ groups = 1 ,
457
+ benchmark = True ,
458
+ deterministic = False ,
459
+ cudnn_enabled = False )
460
+
461
+ @register_test_case (module_factory = lambda : _ConvolutionDeprecated2DBenchmarkModule ())
462
+ def _ConvolutionDeprecated2DBenchmarkModule_basic (module , tu : TestUtils ):
463
+ module .forward (torch .randn (3 , 3 , 10 , 10 ), torch .randn (3 , 3 , 2 , 2 ))
464
+
465
+ class _ConvolutionDeprecated2DDeterministicModule (torch .nn .Module ):
466
+ def __init__ (self ):
467
+ super ().__init__ ()
468
+
469
+ @export
470
+ @annotate_args ([
471
+ None ,
472
+ ([- 1 , - 1 , - 1 , - 1 ], torch .float32 , True ),
473
+ ([- 1 , - 1 , - 1 , - 1 ], torch .float32 , True ),
474
+ ])
475
+ def forward (self , inputVec , weight ):
476
+ return torch .ops .aten ._convolution (inputVec ,
477
+ weight ,
478
+ bias = None ,
479
+ stride = [3 , 3 ],
480
+ padding = [2 , 2 ],
481
+ dilation = [1 , 1 ],
482
+ transposed = False ,
483
+ output_padding = [0 , 0 ],
484
+ groups = 1 ,
485
+ benchmark = False ,
486
+ deterministic = True ,
487
+ cudnn_enabled = False )
488
+
489
+ @register_test_case (module_factory = lambda : _ConvolutionDeprecated2DDeterministicModule ())
490
+ def _ConvolutionDeprecated2DDeterministicModule_basic (module , tu : TestUtils ):
491
+ module .forward (torch .randn (3 , 3 , 10 , 10 ), torch .randn (3 , 3 , 2 , 2 ))
492
+
493
+ class _ConvolutionDeprecated2DCudnnModule (torch .nn .Module ):
494
+ def __init__ (self ):
495
+ super ().__init__ ()
496
+
497
+ @export
498
+ @annotate_args ([
499
+ None ,
500
+ ([- 1 , - 1 , - 1 , - 1 ], torch .float32 , True ),
501
+ ([- 1 , - 1 , - 1 , - 1 ], torch .float32 , True ),
502
+ ])
503
+ def forward (self , inputVec , weight ):
504
+ return torch .ops .aten ._convolution (inputVec ,
505
+ weight ,
506
+ bias = None ,
507
+ stride = [3 , 3 ],
508
+ padding = [2 , 2 ],
509
+ dilation = [1 , 1 ],
510
+ transposed = False ,
511
+ output_padding = [0 , 0 ],
512
+ groups = 1 ,
513
+ benchmark = False ,
514
+ deterministic = False ,
515
+ cudnn_enabled = True )
516
+
517
+ @register_test_case (module_factory = lambda : _ConvolutionDeprecated2DCudnnModule ())
518
+ def _Convolution2DCudnnModule_basic (module , tu : TestUtils ):
519
+ module .forward (torch .randn (3 , 3 , 10 , 10 ), torch .randn (3 , 3 , 2 , 2 ))
520
+
409
521
class ConvolutionModule2DGroups (torch .nn .Module ):
410
522
def __init__ (self ):
411
523
super ().__init__ ()
0 commit comments