@@ -180,7 +180,7 @@ void ComputeTensorUsageCount()
180
180
var ( nodes_in_decreasing_depth , layer_indices ) = BuildMap ( outputs ) ;
181
181
var network_nodes = nodes_in_decreasing_depth
182
182
. Select ( node => MakeNodeKey ( node . Layer . Name , node . Layer . InboundNodes . IndexOf ( node ) ) )
183
- . ToArray ( ) ;
183
+ . ToList ( ) ;
184
184
185
185
var nodes_depths = new Dictionary < INode , int > ( ) ;
186
186
var layers_depths = new Dictionary < ILayer , int > ( ) ;
@@ -221,7 +221,7 @@ void ComputeTensorUsageCount()
221
221
layers_depths [ input_layer ] = 0 ;
222
222
layer_indices [ input_layer ] = - 1 ;
223
223
nodes_depths [ input_layer . InboundNodes [ 0 ] ] = 0 ;
224
- network_nodes . add ( MakeNodeKey ( input_layer . Name , 0 ) ) ;
224
+ network_nodes . Add ( MakeNodeKey ( input_layer . Name , 0 ) ) ;
225
225
}
226
226
}
227
227
@@ -231,15 +231,15 @@ void ComputeTensorUsageCount()
231
231
{
232
232
if ( ! nodes_by_depth . ContainsKey ( depth ) )
233
233
nodes_by_depth [ depth ] = new List < INode > ( ) ;
234
- nodes_by_depth [ depth ] . append ( node ) ;
234
+ nodes_by_depth [ depth ] . Add ( node ) ;
235
235
}
236
236
237
237
var layers_by_depth = new Dictionary < int , List < ILayer > > ( ) ;
238
238
foreach ( var ( layer , depth ) in enumerate ( layers_depths ) )
239
239
{
240
240
if ( ! layers_by_depth . ContainsKey ( depth ) )
241
241
layers_by_depth [ depth ] = new List < ILayer > ( ) ;
242
- layers_by_depth [ depth ] . append ( layer ) ;
242
+ layers_by_depth [ depth ] . Add ( layer ) ;
243
243
}
244
244
245
245
// Get sorted list of layer depths.
@@ -260,7 +260,7 @@ void ComputeTensorUsageCount()
260
260
// Get sorted list of node depths.
261
261
depth_keys = nodes_by_depth . Keys . OrderBy ( x => x ) . Reverse ( ) ;
262
262
263
- return ( network_nodes , nodes_by_depth , layers , layers_by_depth ) ;
263
+ return ( network_nodes . ToArray ( ) , nodes_by_depth , layers , layers_by_depth ) ;
264
264
}
265
265
266
266
string MakeNodeKey ( string layer_name , int node_index )
0 commit comments