@@ -45,11 +45,8 @@ public Loader(SavedObjectGraph object_graph_proto, SavedModel saved_model_proto,
4545 _asset_file_def = meta_graph . AssetFileDef ;
4646 _operation_attributes = meta_graph . GraphDef . Node . ToDictionary ( x => x . Name , x => x . Attr ) ;
4747 _proto = object_graph_proto ;
48- // Debug(Rinne)
49- var temp = _proto . ToString ( ) ;
5048 _export_dir = export_dir ;
51- // TODO: `this._concrete_functions` and `this._restored_concrete_functions`
52- // TODO(Rinne): This method is very slow, needs to be accelareted.
49+ // TODO(Rinne): This method is a bit slow (especially under debug mode), may need to be accelareted.
5350 _concrete_functions = function_deserialization . load_function_def_library (
5451 meta_graph . GraphDef . Library , _proto ) ;
5552 _restored_concrete_functions = new HashSet < string > ( ) ;
@@ -322,11 +319,6 @@ private void _load_checkpoint_save_and_restore_functions()
322319 foreach ( var ( node_id , proto ) in _iter_all_nodes ( ) )
323320 {
324321 var node = get ( node_id ) ;
325- if ( node is null )
326- {
327- // skip it because now we skip the restoration of `Function` and `ConcreteFunction`.
328- continue ;
329- }
330322 if ( proto . SaveableObjects . Keys . Count == 1 && proto . SaveableObjects . First ( ) . Key == TrackableUtils . SERIALIZE_TO_TENSORS_NAME )
331323 {
332324 // Restore Trackable serialize- and restore-from-tensor functions.
@@ -390,7 +382,7 @@ private void _load_nodes()
390382 var optimizer_object = nodes [ optimizer_node_id ] ;
391383 var optimizer_variable = nodes [ slot_variable_proto . OriginalVariableNodeId ] ;
392384
393- // TODO: implement it.
385+ // TODO(Rinne) : implement it.
394386 throw new NotImplementedException ( "The model loading of SavedModel still has some incompleted part." +
395387 " Please submit an issue to https://github.com/SciSharp/TensorFlow.NET/issues." ) ;
396388 }
@@ -508,21 +500,11 @@ public Trackable get(string node_id)
508500 /// <param name="node_id"></param>
509501 private void _add_object_graph_edges ( SavedObject proto , int node_id )
510502 {
511- // Debug(Rinne)
512- if ( node_id == 1 )
513- {
514- Console . WriteLine ( ) ;
515- }
516503 var obj = _nodes [ node_id ] ;
517504 var setter = _node_setters [ node_id ] ;
518505
519506 foreach ( var refer in proto . Children )
520507 {
521- if ( obj is null )
522- {
523- // skip it because now we skip the restoration of `Function` and `ConcreteFunction`.
524- continue ;
525- }
526508 setter . Invoke ( obj , refer . LocalName , _nodes [ refer . NodeId ] ) ;
527509 // TODO(Rinne): deal with "__call__"
528510 }
@@ -553,12 +535,6 @@ private void _add_object_graph_edges(SavedObject proto, int node_id)
553535 private ( Trackable , Action < object , object , object > ) _recreate ( SavedObject proto , int node_id , IDictionary < int , Trackable > nodes )
554536 {
555537 // skip the registered classes.
556- if ( node_id == 16 )
557- {
558- // Debug(Rinne)
559- Console . WriteLine ( ) ;
560- }
561-
562538 Dictionary < OneOf < string , int > , Trackable > dependencies = new ( ) ;
563539 foreach ( var item in _get_node_dependencies ( proto ) )
564540 {
0 commit comments