Skip to content

Commit

Permalink
• Modification per Jan's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
jdcpni committed Nov 25, 2022
1 parent b5e882f commit 524eb8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions psyneulink/core/compositions/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -10089,7 +10089,7 @@ def run(
elif execution_mode & pnlvm.ExecutionMode.PTX:
results += _comp_ex.cuda_run(inputs, num_trials, num_inputs_sets)
else:
assert False, f"Unknown execution mode: {execution_mode}."
assert False, "Unknown execution mode: {}".format(execution_mode)

# Update the parameter for results
self.parameters.results._set(results, context)
Expand Down Expand Up @@ -10481,7 +10481,10 @@ def _execute_controller(self,
context.execution_phase = ContextFlags.PROCESSING
self.controller.execute(context=context)

if execution_mode & pnlvm.ExecutionMode.COMPILED:
else:
assert (execution_mode == pnlvm.ExecutionMode.LLVM
or execution_mode & pnlvm.ExecutionMode._Fallback),\
f"PROGRAM ERROR: Unrecognized compiled execution_mode: '{execution_mode}'."
_comp_ex.execute_node(self.controller, context=context)

context.remove_flag(ContextFlags.PROCESSING)
Expand Down Expand Up @@ -10721,7 +10724,7 @@ def execute(
elif execution_mode & pnlvm.ExecutionMode.PTX:
_comp_ex.cuda_execute(llvm_inputs)
else:
assert False, f"Unknown execution mode: {execution_mode}."
assert False, "Unknown execution mode: {}".format(execution_mode)

report(self,
PROGRESS_REPORT,
Expand Down
2 changes: 1 addition & 1 deletion psyneulink/library/compositions/autodiffcomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def learn(self, *args, **kwargs):
if execution_mode == pnlvm.ExecutionMode.Python:
raise AutodiffCompositionError(f"{self.name} is an AutodiffComposition so its learn() "
f"cannot be called with execution_mode = ExecutionMode.Python; "
f"use ExecutionMode.PyTorch or ExecutionMode.LLVM.")
f"use ExecutionMode.PyTorch or ExecutionMode.LLVMRun.")
# OK, now that the user has been advised to use ExecutionMode.PyTorch and warned *not* to ExecutionMdoe.Python,
# convert ExecutionMode.PyTorch specification to ExecutionMode.Python for internal use (nice, eh?)
if execution_mode == pnlvm.ExecutionMode.PyTorch:
Expand Down

0 comments on commit 524eb8f

Please sign in to comment.