diff --git a/psyneulink/library/compositions/emcomposition.py b/psyneulink/library/compositions/emcomposition.py index 2cfff700cb..b850621760 100644 --- a/psyneulink/library/compositions/emcomposition.py +++ b/psyneulink/library/compositions/emcomposition.py @@ -2736,7 +2736,7 @@ def _identify_target_nodes(self, context)->list: def infer_backpropagation_learning_pathways(self, execution_mode, context=None): if self.concatenate_queries: raise EMCompositionError(f"EMComposition does not support learning with 'concatenate_queries'=True.") - super().infer_backpropagation_learning_pathways(execution_mode, context=context) + return super().infer_backpropagation_learning_pathways(execution_mode, context=context) def do_gradient_optimization(self, retain_in_pnl_options, context, optimization_num=None): # 7/10/24 - MAKE THIS CONTEXT DEPENDENT: CALL super() IF BEING EXECUTED ON ITS OWN? diff --git a/tests/composition/test_emcomposition.py b/tests/composition/test_emcomposition.py index 1ae497034b..e70a683a7c 100644 --- a/tests/composition/test_emcomposition.py +++ b/tests/composition/test_emcomposition.py @@ -340,12 +340,8 @@ def test_field_args_and_map_assignments(self, # Validate targets for target_fields np.testing.assert_allclose(em.target_fields, [True, False, False, True, True]) - # learning_components = em.infer_backpropagation_learning_pathways(pnl.ExecutionMode.Python) learning_components = em.infer_backpropagation_learning_pathways(pnl.ExecutionMode.PyTorch) - # FIX: FOLLOWING LINE SHOULDN'T BE NEEDED - learning_components = [node for node in em.nodes if 'TARGET' in node.name] assert len(learning_components) == 3 - assert 'TARGET for KEY A [RETRIEVED]' in learning_components[0].name assert 'TARGET for KEY VALUE [RETRIEVED]' in learning_components[1].name assert 'TARGET for VALUE LEARN [RETRIEVED]' in learning_components[2].name