@@ -1358,23 +1358,10 @@ def forward(self, x):
1358
1358
model = NormalizeFusion ()
1359
1359
save_data_and_model ("normalize_fusion" , x , model )
1360
1360
1361
- class Resize (nn .Module ):
1362
- def __init__ (self ):
1363
- super (Resize , self ).__init__ ()
1364
-
1365
- def forward (self , x , y ):
1366
- size = y .shape [- 2 :]
1367
- x = F .interpolate (x , size = size , mode = "bilinear" , align_corners = False )
1368
- return x
1369
-
1370
- input_0 = torch .randn (1 , 2 , 3 , 4 )
1371
- input_1 = torch .randn (1 , 2 , 6 , 8 )
1372
- save_data_and_model_multy_inputs ("resize_opset11" , Resize (), input_0 , input_1 , version = 11 )
1373
-
1374
1361
#paddle2onnx model
1375
- class Resize_paddle (paddle .nn .Layer ):
1362
+ class Resize_HumanSeg (paddle .nn .Layer ):
1376
1363
def __init__ (self , ):
1377
- super (Resize_paddle , self ).__init__ ()
1364
+ super (Resize_HumanSeg , self ).__init__ ()
1378
1365
1379
1366
def forward (self , x0 ):
1380
1367
x1 = paddle .nn .functional .interpolate (x0 ,size = [6 ,8 ],mode = 'bilinear' ,align_corners = False )
@@ -1392,4 +1379,4 @@ def save_data_and_paddle_model(model, name, input_data):
1392
1379
1393
1380
input_shape = [1 , 2 , 3 , 4 ]
1394
1381
x = paddle .rand (input_shape , dtype = "float32" )
1395
- save_data_and_paddle_model (Resize_paddle (), "resize_humanseg" , x )
1382
+ save_data_and_paddle_model (Resize_HumanSeg (), "resize_humanseg" , x )
0 commit comments