@ -102,16 +102,19 @@ class SaveOpKernel : public framework::OpKernel<T> {
void SaveSelectedRows ( const framework : : ExecutionContext & ctx ,
void SaveSelectedRows ( const framework : : ExecutionContext & ctx ,
const platform : : Place & place ,
const platform : : Place & place ,
const framework : : Variable * var ) const {
const framework : : Variable * var ) const {
framework : : Variable * out_put_var = ctx . OutputVar ( LOOKUP_TABLE_PATH ) ;
auto file_path = ctx . Attr < std : : string > ( " file_path " ) ;
auto file_path = ctx . Attr < std : : string > ( " file_path " ) ;
auto overwrite = ctx . Attr < bool > ( " overwrite " ) ;
auto overwrite = ctx . Attr < bool > ( " overwrite " ) ;
std : : string filename = file_path ;
std : : string filename = file_path ;
VLOG ( 4 ) < < " SaveSelectedRows output file_path: " < < file_path ;
framework : : Variable * out_put_var = ctx . scope ( ) . FindVar ( LOOKUP_TABLE_PATH ) ;
if ( out_put_var ! = nullptr ) {
if ( out_put_var ! = nullptr ) {
auto * lt_var = out_put_var - > GetMutable < std : : string > ( ) ;
auto * lt_var = out_put_var - > GetMutable < std : : string > ( ) ;
filename = * lt_var ;
if ( lt_var - > length ( ) > 0 ) {
VLOG ( 4 ) < < " SaveSelectedRows output var name: " < < * lt_var ;
filename = * lt_var ;
}
}
}
if ( FileExists ( filename ) & & ! overwrite ) {
if ( FileExists ( filename ) & & ! overwrite ) {