@@ -431,7 +431,8 @@ def emb_pool(ids, table_name, is_distributed):
431
431
title_emb = emb_pool (title_ids , self .lookup_table_name , is_distributed )
432
432
brand_emb = emb_pool (brand_ids , self .lookup_table_name , is_distributed )
433
433
profile_emb = emb_pool (profile_ids , "profile_emb" , False )
434
- fc0 = fluid .layers .concat (input = [title_emb , brand_emb , profile_emb ], axis = 1 )
434
+ fc0 = fluid .layers .concat (
435
+ input = [title_emb , brand_emb , profile_emb ], axis = 1 )
435
436
predict = fluid .layers .fc (input = fc0 ,
436
437
size = 2 ,
437
438
act = None ,
@@ -471,13 +472,14 @@ def transpiler_test_impl(self):
471
472
self .assertEqual (len (trainer .blocks ), 1 )
472
473
ops = [
473
474
'lookup_table' , 'sequence_pool' , 'lookup_table' , 'sequence_pool' ,
474
- 'lookup_table' , 'sequence_pool' , 'concat' , 'mul' , 'elementwise_add' , 'cross_entropy' , 'mean' ,
475
- 'fill_constant' , 'mean_grad' , 'cross_entropy_grad' ,
476
- 'elementwise_add_grad' , 'send' , 'mul_grad' , 'send' , 'concat_grad' ,
477
- 'sequence_pool_grad' , 'lookup_table_grad' , 'split_selected_rows' , 'send' ,
478
- 'sequence_pool_grad' , 'lookup_table_grad' , 'sequence_pool_grad' ,
479
- 'lookup_table_grad' , 'sum' , 'split_selected_rows' , 'send' ,
480
- 'send_barrier' , 'recv' , 'recv' , 'recv' , 'recv' , 'fetch_barrier' , 'concat' , 'concat'
475
+ 'lookup_table' , 'sequence_pool' , 'concat' , 'mul' , 'elementwise_add' ,
476
+ 'cross_entropy' , 'mean' , 'fill_constant' , 'mean_grad' ,
477
+ 'cross_entropy_grad' , 'elementwise_add_grad' , 'send' , 'mul_grad' ,
478
+ 'send' , 'concat_grad' , 'sequence_pool_grad' , 'lookup_table_grad' ,
479
+ 'split_selected_rows' , 'send' , 'sequence_pool_grad' ,
480
+ 'lookup_table_grad' , 'sequence_pool_grad' , 'lookup_table_grad' ,
481
+ 'sum' , 'split_selected_rows' , 'send' , 'send_barrier' , 'recv' ,
482
+ 'recv' , 'recv' , 'recv' , 'fetch_barrier' , 'concat' , 'concat'
481
483
]
482
484
self .assertEqual ([op .type for op in trainer .blocks [0 ].ops ], ops )
483
485
@@ -510,21 +512,25 @@ def transpiler_test_impl(self):
510
512
self .assertEqual (len (trainer .blocks ), 1 )
511
513
ops = [
512
514
'split_ids' , 'prefetch' , 'merge_ids' , 'sequence_pool' ,
513
- 'sequence_pool' , 'lookup_table' , 'sequence_pool' , 'concat' , 'mul' , 'elementwise_add' ,
514
- 'cross_entropy' , 'mean' , 'fill_constant' , 'mean_grad' ,
515
- 'cross_entropy_grad' , 'elementwise_add_grad' , 'send' , 'mul_grad' ,
516
- 'send' , 'concat_grad' , 'sequence_pool_grad' , 'lookup_table_grad' ,
517
- 'split_selected_rows' , 'send' , 'sequence_pool_grad' , 'lookup_table_grad' ,
518
- 'sequence_pool_grad' , 'lookup_table_grad' , 'sum' , 'split_ids' , 'send' , 'send_barrier' ,
519
- 'recv' , 'recv' , 'recv' , 'fetch_barrier' , 'concat' ]
515
+ 'sequence_pool' , 'lookup_table' , 'sequence_pool' , 'concat' , 'mul' ,
516
+ 'elementwise_add' , 'cross_entropy' , 'mean' , 'fill_constant' ,
517
+ 'mean_grad' , 'cross_entropy_grad' , 'elementwise_add_grad' , 'send' ,
518
+ 'mul_grad' , 'send' , 'concat_grad' , 'sequence_pool_grad' ,
519
+ 'lookup_table_grad' , 'split_selected_rows' , 'send' ,
520
+ 'sequence_pool_grad' , 'lookup_table_grad' , 'sequence_pool_grad' ,
521
+ 'lookup_table_grad' , 'sum' , 'split_ids' , 'send' , 'send_barrier' ,
522
+ 'recv' , 'recv' , 'recv' , 'fetch_barrier' , 'concat'
523
+ ]
520
524
self .assertEqual ([op .type for op in trainer .blocks [0 ].ops ], ops )
521
525
startup_ops = [
522
526
'fill_constant' , 'fill_constant' , 'fill_constant' , 'fill_constant' ,
523
527
'fill_constant' , 'fill_constant' , 'fill_constant' , 'fill_constant' ,
524
528
'fill_constant' , 'fill_constant' , 'fill_constant' , 'fill_constant' ,
525
529
'fill_constant' , 'fill_constant' , 'fill_constant' , 'fill_constant' ,
526
- 'fill_constant' , 'fill_constant' , 'uniform_random' , 'uniform_random' ,
527
- 'recv' , 'recv' , 'recv' , 'fetch_barrier' , 'concat' , 'fake_init' ]
530
+ 'fill_constant' , 'fill_constant' , 'uniform_random' ,
531
+ 'uniform_random' , 'recv' , 'recv' , 'recv' , 'fetch_barrier' , 'concat' ,
532
+ 'fake_init'
533
+ ]
528
534
self .assertEqual ([op .type for op in trainer_startup .blocks [0 ].ops ],
529
535
startup_ops )
530
536
@@ -557,13 +563,12 @@ def transpiler_test_impl(self):
557
563
'lookup_table' , 'sequence_pool' , 'lookup_table' , 'sequence_pool' ,
558
564
'lookup_table' , 'sequence_pool' , 'concat' , 'mul' , 'elementwise_add' ,
559
565
'cross_entropy' , 'mean' , 'fill_constant' , 'mean_grad' ,
560
- 'cross_entropy_grad' , 'elementwise_add_grad' , 'send' ,
561
- 'mul_grad' , 'send' , 'concat_grad' , 'sequence_pool_grad' ,
562
- 'lookup_table_grad' , 'split_selected_rows' , 'send' ,
563
- 'sequence_pool_grad' , 'lookup_table_grad' ,
564
- 'sequence_pool_grad' , 'lookup_table_grad' ,
565
- 'sum' , 'split_selected_rows' , 'send' , 'recv' , 'recv' , 'recv' , 'recv' ,
566
- 'concat' , 'concat'
566
+ 'cross_entropy_grad' , 'elementwise_add_grad' , 'send' , 'mul_grad' ,
567
+ 'send' , 'concat_grad' , 'sequence_pool_grad' , 'lookup_table_grad' ,
568
+ 'split_selected_rows' , 'send' , 'sequence_pool_grad' ,
569
+ 'lookup_table_grad' , 'sequence_pool_grad' , 'lookup_table_grad' ,
570
+ 'sum' , 'split_selected_rows' , 'send' , 'recv' , 'recv' , 'recv' ,
571
+ 'recv' , 'concat' , 'concat'
567
572
]
568
573
self .assertEqual ([op .type for op in trainer .blocks [0 ].ops ], ops )
569
574
@@ -597,14 +602,15 @@ def transpiler_test_impl(self):
597
602
self .assertEqual (len (trainer .blocks ), 1 )
598
603
ops = [
599
604
'split_ids' , 'prefetch' , 'merge_ids' , 'sequence_pool' ,
600
- 'sequence_pool' , 'lookup_table' , 'sequence_pool' ,
601
- 'concat' , 'mul' , 'elementwise_add' , 'cross_entropy' ,
602
- 'mean' , 'fill_constant' , 'mean_grad' , 'cross_entropy_grad' ,
603
- 'elementwise_add_grad' , 'send' , 'mul_grad' , 'send' ,
604
- 'concat_grad' , 'sequence_pool_grad' , 'lookup_table_grad' ,
605
- 'split_selected_rows' , 'send' , 'sequence_pool_grad' ,
606
- 'lookup_table_grad' , 'sequence_pool_grad' , 'lookup_table_grad' ,
607
- 'sum' , 'split_ids' , 'send' , 'recv' , 'recv' , 'recv' , 'concat' ]
605
+ 'sequence_pool' , 'lookup_table' , 'sequence_pool' , 'concat' , 'mul' ,
606
+ 'elementwise_add' , 'cross_entropy' , 'mean' , 'fill_constant' ,
607
+ 'mean_grad' , 'cross_entropy_grad' , 'elementwise_add_grad' , 'send' ,
608
+ 'mul_grad' , 'send' , 'concat_grad' , 'sequence_pool_grad' ,
609
+ 'lookup_table_grad' , 'split_selected_rows' , 'send' ,
610
+ 'sequence_pool_grad' , 'lookup_table_grad' , 'sequence_pool_grad' ,
611
+ 'lookup_table_grad' , 'sum' , 'split_ids' , 'send' , 'recv' , 'recv' ,
612
+ 'recv' , 'concat'
613
+ ]
608
614
self .assertEqual ([op .type for op in trainer .blocks [0 ].ops ], ops )
609
615
610
616
0 commit comments