Skip to content

Commit 1eada61

Browse files
committed
Remove redundant subgraphs.
1 parent 26b99b6 commit 1eada61

File tree

1,044 files changed

+33052
-152239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,044 files changed

+33052
-152239
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1c86568233f9b834312d9525c485088ea33394123460e0ad7ddb2644d1bc2a7e
1+
ef1cff7d6a09085f5a39414177fefe578d79f40af14d0cf5f79e9d5fbd2cd740
Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,53 @@
11
class Program_weight_tensor_data_0:
22
name = "data_0"
3-
shape = [196192]
4-
dtype = "int32"
5-
min_val = 0
6-
max_val = 196191
7-
data = None
3+
shape = []
4+
dtype = "int64"
5+
data = [3]
86

97

108
class Program_weight_tensor_data_1:
119
name = "data_1"
12-
shape = []
10+
shape = [512]
1311
dtype = "int64"
14-
data = [253]
12+
min_val = 0
13+
max_val = 511
14+
data = None
1515

1616

1717
class Program_weight_tensor_data_2:
1818
name = "data_2"
19-
shape = [196192]
20-
dtype = "int32"
21-
min_val = 0
22-
max_val = 196415
19+
shape = [512, 4]
20+
dtype = "float32"
21+
max_val = float("1023.9")
22+
mean = float("564.285")
23+
std = float("272.403")
2324
data = None
2425

2526

2627
class Program_weight_tensor_data_3:
2728
name = "data_3"
28-
shape = []
29+
shape = [512]
2930
dtype = "int64"
30-
data = [3]
31+
min_val = 0
32+
max_val = 2
33+
data = None
34+
35+
36+
class Program_weight_tensor_data_4:
37+
name = "data_4"
38+
shape = [3, 4]
39+
dtype = "float32"
40+
data = [
41+
399.36,
42+
483.84,
43+
458.24,
44+
542.72,
45+
680.96,
46+
599.04,
47+
747.52,
48+
668.16,
49+
642.56,
50+
606.72,
51+
688.64,
52+
727.04,
53+
]

paddle_samples/PaddleX/Cascade-FasterRCNN-ResNet50-FPN/subgraph_0/model.py

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,43 @@ class GraphModule(paddle.nn.Layer):
55
def __init__(self):
66
super().__init__()
77

8-
def forward(self, data_0, data_1, data_2, data_3):
9-
# pd_op.full_int_array: (1xi64) <- ()
10-
full_int_array_0 = [0]
8+
def forward(self, data_0, data_1, data_2, data_3, data_4):
9+
# pd_op.full: (xi64) <- ()
10+
full_0 = paddle._C_ops.full(
11+
[], float("0"), paddle.int64, paddle.framework._current_expected_place()
12+
)
1113

12-
# builtin.combine: ([xi64]) <- (xi64)
13-
combine_0 = [data_1]
14-
del data_1
14+
# pd_op.greater_than: (xb) <- (xi64, xi64)
15+
greater_than_0 = paddle._C_ops.greater_than(data_0, full_0)
16+
del data_0
1517

16-
# pd_op.stack: (1xi64) <- ([xi64])
17-
stack_0 = paddle._C_ops.stack(combine_0, 0)
18-
del combine_0
18+
# pd_op.cast: (xi64) <- (xb)
19+
cast_0 = paddle._C_ops.cast(greater_than_0, paddle.int64)
20+
del greater_than_0
1921

20-
# pd_op.slice: (-1xi32) <- (196192xi32, 1xi64, 1xi64)
21-
slice_0 = paddle._C_ops.slice(data_0, [0], full_int_array_0, stack_0, [-1], [])
22-
del data_0, full_int_array_0, stack_0
22+
# pd_op.not_equal: (xb) <- (xi64, xi64)
23+
not_equal_0 = paddle._C_ops.not_equal(cast_0, full_0)
24+
del cast_0
2325

24-
# pd_op.full: (1xi32) <- ()
25-
full_0 = paddle._C_ops.full(
26-
[1], float("0"), paddle.int32, paddle.core.CPUPlace()
27-
)
26+
# pd_op.cast: (xi64) <- (xb)
27+
cast_1 = paddle._C_ops.cast(not_equal_0, paddle.int64)
28+
del not_equal_0
2829

29-
# pd_op.gather: (-1xi32) <- (196192xi32, -1xi32, 1xi32)
30-
gather_0 = paddle._C_ops.gather(data_2, slice_0, full_0)
31-
del data_2, full_0, slice_0
30+
# pd_op.equal: (xb) <- (xi64, xi64)
31+
equal_0 = paddle._C_ops.equal(cast_1, full_0)
32+
del cast_1, full_0
3233

33-
# pd_op.full: (xi64) <- ()
34+
# pd_op.full: (1xi32) <- ()
3435
full_1 = paddle._C_ops.full(
35-
[], float("0"), paddle.int64, paddle.framework._current_expected_place()
36+
[1], float("0"), paddle.int32, paddle.core.CPUPlace()
3637
)
3738

38-
# pd_op.equal: (xb) <- (xi64, xi64)
39-
equal_0 = paddle._C_ops.equal(data_3, full_1)
40-
del data_3, full_1
39+
# pd_op.gather: (-1x4xf32) <- (-1x4xf32, -1xi64, 1xi32)
40+
gather_0 = paddle._C_ops.gather(data_4, data_3, full_1)
41+
del data_3, data_4, full_1
42+
43+
# pd_op.shape64: (1xi64) <- (512xi64)
44+
shape64_0 = paddle._C_ops.shape64(data_1)
45+
del data_1
4146

42-
return equal_0, gather_0
47+
return gather_0, shape64_0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
00ef08cc89ec8f8051c57321c9dd142e65268c6a6cab8a869a81bcd6f9d10a0d
1+
d84efc51ae2a7d78f2c99b1540a638f4add520ed84de5d62907935b05a8cf292
Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
11
class Program_weight_tensor_data_0:
22
name = "data_0"
3-
shape = [2]
4-
dtype = "int32"
5-
data = [0, 1]
3+
shape = [512, 4]
4+
dtype = "float32"
5+
max_val = float("1018.05")
6+
mean = float("439.025")
7+
std = float("231.686")
8+
data = None
69

710

811
class Program_weight_tensor_data_1:
912
name = "data_1"
10-
shape = []
11-
dtype = "int64"
12-
data = [2]
13+
shape = [512, 4]
14+
dtype = "float32"
15+
max_val = float("938.986")
16+
mean = float("467.502")
17+
std = float("224.196")
18+
data = None
1319

1420

1521
class Program_weight_tensor_data_2:
1622
name = "data_2"
17-
shape = [2]
18-
dtype = "int32"
19-
data = [189304, 189448]
23+
shape = [512, 4]
24+
dtype = "float32"
25+
max_val = float("936.918")
26+
mean = float("499.308")
27+
std = float("203.062")
28+
data = None
29+
30+
31+
class Program_weight_tensor_data_3:
32+
name = "data_3"
33+
shape = [512, 4]
34+
dtype = "float32"
35+
max_val = float("981.0")
36+
mean = float("506.296")
37+
std = float("288.897")
38+
data = None

paddle_samples/PaddleX/Cascade-FasterRCNN-ResNet50-FPN/subgraph_1/model.py

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,64 @@ class GraphModule(paddle.nn.Layer):
55
def __init__(self):
66
super().__init__()
77

8-
def forward(self, data_0, data_1, data_2):
8+
def forward(self, data_0, data_1, data_2, data_3):
9+
# pd_op.shape64: (2xi64) <- (512x4xf32)
10+
shape64_0 = paddle._C_ops.shape64(data_0)
11+
del data_0
12+
913
# pd_op.full_int_array: (1xi64) <- ()
1014
full_int_array_0 = [0]
1115

12-
# builtin.combine: ([xi64]) <- (xi64)
13-
combine_0 = [data_1]
16+
# pd_op.full_int_array: (1xi64) <- ()
17+
full_int_array_1 = [1]
18+
19+
# pd_op.slice: (1xi64) <- (2xi64, 1xi64, 1xi64)
20+
slice_0 = paddle._C_ops.slice(
21+
shape64_0, [0], full_int_array_0, full_int_array_1, [1], []
22+
)
23+
del shape64_0
24+
25+
# pd_op.shape64: (2xi64) <- (512x4xf32)
26+
shape64_1 = paddle._C_ops.shape64(data_1)
1427
del data_1
1528

16-
# pd_op.stack: (1xi64) <- ([xi64])
17-
stack_0 = paddle._C_ops.stack(combine_0, 0)
18-
del combine_0
29+
# pd_op.slice: (1xi64) <- (2xi64, 1xi64, 1xi64)
30+
slice_1 = paddle._C_ops.slice(
31+
shape64_1, [0], full_int_array_0, full_int_array_1, [1], []
32+
)
33+
del shape64_1
34+
35+
# pd_op.shape64: (2xi64) <- (512x4xf32)
36+
shape64_2 = paddle._C_ops.shape64(data_2)
37+
del data_2
38+
39+
# pd_op.slice: (1xi64) <- (2xi64, 1xi64, 1xi64)
40+
slice_2 = paddle._C_ops.slice(
41+
shape64_2, [0], full_int_array_0, full_int_array_1, [1], []
42+
)
43+
del shape64_2
44+
45+
# pd_op.shape64: (2xi64) <- (512x4xf32)
46+
shape64_3 = paddle._C_ops.shape64(data_3)
47+
del data_3
1948

20-
# pd_op.slice: (-1xi32) <- (-1xi32, 1xi64, 1xi64)
21-
slice_0 = paddle._C_ops.slice(data_0, [0], full_int_array_0, stack_0, [-1], [])
22-
del data_0, full_int_array_0, stack_0
49+
# pd_op.slice: (1xi64) <- (2xi64, 1xi64, 1xi64)
50+
slice_3 = paddle._C_ops.slice(
51+
shape64_3, [0], full_int_array_0, full_int_array_1, [1], []
52+
)
53+
del full_int_array_0, full_int_array_1, shape64_3
2354

2455
# pd_op.full: (1xi32) <- ()
2556
full_0 = paddle._C_ops.full(
2657
[1], float("0"), paddle.int32, paddle.core.CPUPlace()
2758
)
2859

29-
# pd_op.gather: (-1xi32) <- (-1xi32, -1xi32, 1xi32)
30-
gather_0 = paddle._C_ops.gather(data_2, slice_0, full_0)
31-
del data_2, full_0, slice_0
60+
# builtin.combine: ([1xi64, 1xi64, 1xi64, 1xi64]) <- (1xi64, 1xi64, 1xi64, 1xi64)
61+
combine_0 = [slice_0, slice_1, slice_2, slice_3]
62+
del slice_0, slice_1, slice_2, slice_3
63+
64+
# pd_op.concat: (4xi64) <- ([1xi64, 1xi64, 1xi64, 1xi64], 1xi32)
65+
concat_0 = paddle._C_ops.concat(combine_0, full_0)
66+
del combine_0, full_0
3267

33-
return gather_0
68+
return concat_0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6ddc5e365a0df1ad0980b33a3406df8ce549af95c792ad830f7e716a5238682d
1+
206a876d6190d115b369f533cf8d5e575d5e24f34adac88203001b7df9923f6f

0 commit comments

Comments
 (0)