Skip to content

Commit

Permalink
Fix part of error
Browse files Browse the repository at this point in the history
Signed-off-by: Xu, He <he.xu@intel.com>
  • Loading branch information
hexu33 committed Mar 16, 2023
1 parent ffe4e85 commit c42df5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 30 deletions.
38 changes: 11 additions & 27 deletions tutorials/in_depth/tutorial04_execution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
Expand All @@ -302,7 +303,11 @@
"source": [
"3. Compile stage: After a _Process_ has been configured, it needs to be compiled to\n",
"become executable. After the compilation stage, the state of the _Process_ can\n",
"still be manipulated and inspected."
"still be manipulated and inspected.\n",
"\n",
"4. Execution stage: When compilation is complete, _Processes_ can be\n",
"executed. The execution stage ensures that the (prior) compilation stage has\n",
"been completed and otherwise invokes it."
]
},
{
Expand All @@ -315,39 +320,18 @@
},
"outputs": [],
"source": [
"# Compile stage\n",
"from lava.magma.compiler.compiler import Compiler\n",
"from lava.magma.core.run_configs import Loihi1SimCfg\n",
"\n",
"# create a compiler\n",
"compiler = Compiler()\n",
"\n",
"# compile the Process (and all connected Processes) into an executable\n",
"executable = compiler.compile(lif2, run_cfg=Loihi1SimCfg())"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"4. Execution stage: When compilation is complete, _Processes_ can be\n",
"executed. The execution stage ensures that the (prior) compilation stage has\n",
"been completed and otherwise invokes it."
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"executable = compiler.compile(lif2, run_cfg=Loihi1SimCfg())\n",
"\n",
"# Execution stage\n",
"\n",
"from lava.magma.runtime.runtime import Runtime\n",
"from lava.magma.core.run_conditions import RunSteps\n",
"from lava.magma.runtime.message_infrastructure.message_interface_enum import ActorType\n",
Expand Down
4 changes: 1 addition & 3 deletions tutorials/in_depth/tutorial05_connect_processes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
" def run_spk(self):\n",
" data = np.array([1, 2])\n",
" self.out.send(data)\n",
" print(\"Sent output data of P1: {}\".format(data))\n",
"\n",
"\n",
"\n",
Expand All @@ -137,8 +136,7 @@
" inp: PyInPort = LavaPyType(PyInPort.VEC_DENSE, int)\n",
"\n",
" def run_spk(self):\n",
" in_data = self.inp.recv()\n",
" print(\"Received input data for P2: {}\".format(in_data))"
" in_data = self.inp.recv()"
]
},
{
Expand Down

0 comments on commit c42df5c

Please sign in to comment.