@@ -387,13 +387,6 @@ private void _load_nodes()
387387 }
388388 else
389389 {
390- // skip the function and concrete function.
391- if ( proto . KindCase == SavedObject . KindOneofCase . BareConcreteFunction || proto . KindCase == SavedObject . KindOneofCase . Function )
392- {
393- nodes [ node_id ] = null ;
394- node_setters [ node_id ] = null ;
395- continue ;
396- }
397390 var ( node , setter ) = _recreate ( proto , node_id , nodes ) ;
398391 nodes [ node_id ] = node ;
399392 node_setters [ node_id ] = setter ;
@@ -471,6 +464,11 @@ private void _load_edges()
471464 }
472465 }
473466
467+ private void _setup_function_captures ( )
468+ {
469+ // TODO: implement it with concrete functions.
470+ }
471+
474472 private void _setup_remaining_functions ( )
475473 {
476474 // TODO: implement it with concrete functions.
@@ -542,9 +540,9 @@ private void _add_object_graph_edges(SavedObject proto, int node_id)
542540
543541 return proto . KindCase switch
544542 {
545- SavedObject . KindOneofCase . Resource => RestoredResource . deserialize_from_proto ( ) ,
546- SavedObject . KindOneofCase . Asset => Asset . deserialize_from_proto ( ) ,
547- SavedObject . KindOneofCase . Constant => TrackableConstant . deserialize_from_proto ( ) ,
543+ SavedObject . KindOneofCase . Resource => RestoredResource . deserialize_from_proto ( proto , _operation_attributes ) ,
544+ SavedObject . KindOneofCase . Asset => AssetResource . deserialize_from_proto ( proto , _export_dir , _asset_file_def , _operation_attributes ) ,
545+ SavedObject . KindOneofCase . Constant => TrackableConstant . deserialize_from_proto ( proto , _operation_attributes ) ,
548546 _ => _recreate_default ( proto , node_id , dependencies )
549547 } ;
550548 }
@@ -563,7 +561,8 @@ private void _add_object_graph_edges(SavedObject proto, int node_id)
563561 SavedObject . KindOneofCase . Function => _recreate_function ( proto . Function , null ) ,
564562 SavedObject . KindOneofCase . BareConcreteFunction => throw new NotImplementedException ( ) ,
565563 SavedObject . KindOneofCase . Variable => _recreate_variable ( proto . Variable ) ,
566- SavedObject . KindOneofCase . CapturedTensor => throw new NotImplementedException ( )
564+ SavedObject . KindOneofCase . CapturedTensor => throw new NotImplementedException ( ) ,
565+ _ => throw new NotImplementedException ( )
567566 } ;
568567 }
569568
@@ -623,8 +622,12 @@ private void _add_object_graph_edges(SavedObject proto, int node_id)
623622 private ( ConcreteFunction , Action < object , object , object > ) _recreate_function ( SavedFunction proto ,
624623 Dictionary < Maybe < string , int > , Trackable > dependencies )
625624 {
626- throw new NotImplementedException ( ) ;
627- //var fn = function_deserialization.setup_bare_concrete_function(proto, )
625+ var fn = function_deserialization . recreate_function ( proto , null ) ;
626+ foreach ( var name in proto . ConcreteFunctions )
627+ {
628+ _setup_function_captures ( ) ;
629+ }
630+ return ( fn , setattr ) ;
628631 }
629632
630633 private ( ConcreteFunction , Action < object , object , object > ) _recreate_bare_concrete_function ( SavedBareConcreteFunction proto ,
0 commit comments