Skip to content

Commit

Permalink
Update A_first_example.ipynb (#131)
Browse files Browse the repository at this point in the history
Otherwise, line 173 returns

```
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[9], line 1
----> 1 u = flow.units.convert_velocity_to_pu(lattice.u(simulation.f)).numpy()
      2 u_norm = np.linalg.norm(u,axis=0)
      3 plt.imshow(u_norm)

TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
```
  • Loading branch information
PhiSpel authored Apr 13, 2023
1 parent 6c09fdd commit 63be919
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/A_first_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
}
],
"source": [
"u = flow.units.convert_velocity_to_pu(lattice.u(simulation.f)).numpy()\n",
"u = flow.units.convert_velocity_to_pu(lattice.u(simulation.f)).cpu().numpy()\n",
"u_norm = np.linalg.norm(u,axis=0)\n",
"plt.imshow(u_norm)\n",
"plt.show()"
Expand Down

0 comments on commit 63be919

Please sign in to comment.