@ -275,7 +275,7 @@ All parameter, weight, gradient are variables in Paddle.
const std : : vector < std : : array < size_t , 2 > > & targets ) {
ProgramDescBind prog_with_targets ( origin ) ;
for ( const auto & t : targets ) {
prog_with_targets . Block( t [ 0 ] ) - > Op ( t [ 1 ] ) - > MarkAsTarget ( ) ;
prog_with_targets . Mutable Block( t [ 0 ] ) - > Op ( t [ 1 ] ) - > MarkAsTarget ( ) ;
}
ProgramDesc pruned_desc ;
Prune ( * prog_with_targets . Proto ( ) , & pruned_desc ) ;
@ -335,7 +335,7 @@ All parameter, weight, gradient are variables in Paddle.
PADDLE_ENFORCE ( desc . IsInitialized ( ) ,
" User OpDesc is not initialized, reason %s " ,
desc . InitializationErrorString ( ) ) ;
return OpRegistry : : CreateOp ( desc , nullptr );
return OpRegistry : : CreateOp ( desc );
} )
. def ( " backward " ,
[ ] ( const OperatorBase & forwardOp ,
@ -439,7 +439,7 @@ All parameter, weight, gradient are variables in Paddle.
PADDLE_ENFORCE ( desc . IsInitialized ( ) ,
" User OpDesc is not initialized, reason %s " ,
desc . InitializationErrorString ( ) ) ;
auto rnn_op = OpRegistry : : CreateOp ( desc , nullptr );
auto rnn_op = OpRegistry : : CreateOp ( desc );
return static_cast < operators : : RecurrentOp * > ( rnn_op . release ( ) ) ;
} )
. def ( " set_stepnet " , [ ] ( operators : : RecurrentOp & self ,
@ -457,7 +457,7 @@ All parameter, weight, gradient are variables in Paddle.
PADDLE_ENFORCE ( desc . IsInitialized ( ) ,
" User OpDesc is not initialized, reason %s " ,
desc . InitializationErrorString ( ) ) ;
auto rnn_op = OpRegistry : : CreateOp ( desc , nullptr );
auto rnn_op = OpRegistry : : CreateOp ( desc );
return static_cast < operators : : DynamicRecurrentOp * > (
rnn_op . release ( ) ) ;
} )
@ -484,7 +484,7 @@ All parameter, weight, gradient are variables in Paddle.
PADDLE_ENFORCE ( desc . IsInitialized ( ) ,
" User OpDesc is not initialized, reason %s " ,
desc . InitializationErrorString ( ) ) ;
auto cond_op = OpRegistry : : CreateOp ( desc , nullptr );
auto cond_op = OpRegistry : : CreateOp ( desc );
return static_cast < operators : : CondOp * > ( cond_op . release ( ) ) ;
} )
. def ( " set_truenet " ,
@ -498,10 +498,7 @@ All parameter, weight, gradient are variables in Paddle.
py : : class_ < framework : : Executor > ( m , " Executor " )
. def ( py : : init < std : : vector < platform : : Place > & > ( ) )
. def ( " run " , [ ] ( Executor & self , ProgramDescBind * program_bind ,
Scope * scope , int block_id ) {
self . Run ( * program_bind - > Proto ( ) , scope , block_id ) ;
} ) ;
. def ( " run " , & Executor : : Run ) ;
m . def ( " unique_integer " , UniqueIntegerGenerator ) ;
m . def ( " init_gflags " , InitGflags ) ;