File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1016,7 +1016,18 @@ void model::setup_layer_grid_tags(const std::vector<El::Grid*>& fngrids)
1016
1016
// the same, set to parent value. If any is different, set to 0.
1017
1017
// (Note that if we're doing "layer parallelism", they should all be
1018
1018
// -1 and this definition will recover that.)
1019
- for (auto & layer : this ->get_layers ()) {
1019
+ bool doing_subgraph_stuff = false ;
1020
+ auto const layers = this ->get_layers ();
1021
+ for (auto & layer : layers) {
1022
+ if (layer->get_grid_tag () >= 0 ) {
1023
+ doing_subgraph_stuff = true ;
1024
+ break ;
1025
+ }
1026
+ }
1027
+ if (!doing_subgraph_stuff)
1028
+ return ;
1029
+
1030
+ for (auto & layer : layers) {
1020
1031
int tag = layer->get_grid_tag ();
1021
1032
if (tag < 0 ) {
1022
1033
tag = 0 ; // now it's at least valid if there are no parents
You can’t perform that action at this time.
0 commit comments