Skip to content

Commit e7933d3

Browse files
committed
NumPy to CuPy - SVD Reconstruction: s/asarray/asnumpy
1 parent df7e4e9 commit e7933d3

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

notebooks/4__numpy_to_cupy__svd_reconstruction__SOLUTION.ipynb

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
"\n",
1515
"- Change `import numpy as xp` to `import cupy as xp`.\n",
1616
"- NumPy arrays are converted to CuPy arrays using `xp.asarray()`. You'll see errors like `only supports cupy.ndarray` when you have this problem.\n",
17-
"- CuPy arrays are converted back to NumPy arrays (for Matplotlib) using `xp.asarray()`.\n",
17+
"- CuPy arrays are converted back to NumPy arrays (for Matplotlib) using `xp.asnumpy()`.\n",
1818
"\n",
1919
"First, we need to import the compute vision and plotting stack we're using:"
2020
]
2121
},
2222
{
2323
"cell_type": "code",
24-
"execution_count": 1,
24+
"execution_count": null,
2525
"metadata": {
2626
"id": "mLnsPrdx5hP0"
2727
},
@@ -43,7 +43,7 @@
4343
},
4444
{
4545
"cell_type": "code",
46-
"execution_count": 2,
46+
"execution_count": null,
4747
"metadata": {
4848
"colab": {
4949
"base_uri": "https://localhost:8080/"
@@ -81,7 +81,7 @@
8181
},
8282
{
8383
"cell_type": "code",
84-
"execution_count": 3,
84+
"execution_count": null,
8585
"metadata": {
8686
"colab": {
8787
"base_uri": "https://localhost:8080/"
@@ -127,7 +127,7 @@
127127
},
128128
{
129129
"cell_type": "code",
130-
"execution_count": 4,
130+
"execution_count": null,
131131
"metadata": {
132132
"colab": {
133133
"base_uri": "https://localhost:8080/",
@@ -170,7 +170,7 @@
170170
},
171171
{
172172
"cell_type": "code",
173-
"execution_count": 5,
173+
"execution_count": null,
174174
"metadata": {
175175
"colab": {
176176
"base_uri": "https://localhost:8080/"
@@ -215,7 +215,7 @@
215215
},
216216
{
217217
"cell_type": "code",
218-
"execution_count": 6,
218+
"execution_count": null,
219219
"metadata": {
220220
"id": "nivfn6yjxBJ0",
221221
"outputId": "f7a34fd0-47bd-4175-ece1-7293bef91fcb",
@@ -252,7 +252,7 @@
252252
},
253253
{
254254
"cell_type": "code",
255-
"execution_count": 7,
255+
"execution_count": null,
256256
"metadata": {
257257
"id": "utw8ijY_xBJ-",
258258
"outputId": "3e0e8ee9-4e8c-45c8-9b46-79c31b8f92de",
@@ -299,7 +299,7 @@
299299
},
300300
{
301301
"cell_type": "code",
302-
"execution_count": 8,
302+
"execution_count": null,
303303
"metadata": {
304304
"id": "_fJKReznxBZP",
305305
"outputId": "953c4a04-5633-42cd-ac89-c10eb8a55031",
@@ -342,7 +342,7 @@
342342
},
343343
{
344344
"cell_type": "code",
345-
"execution_count": 9,
345+
"execution_count": null,
346346
"metadata": {
347347
"colab": {
348348
"base_uri": "https://localhost:8080/",
@@ -391,7 +391,7 @@
391391
},
392392
{
393393
"cell_type": "code",
394-
"execution_count": 10,
394+
"execution_count": null,
395395
"metadata": {
396396
"id": "bDcxX1HlxBZS",
397397
"outputId": "68be35b8-a2cb-4c1e-a32d-03eff0763e6a",
@@ -428,7 +428,7 @@
428428
},
429429
{
430430
"cell_type": "code",
431-
"execution_count": 11,
431+
"execution_count": null,
432432
"metadata": {
433433
"id": "3JgERy0mxBZT",
434434
"outputId": "2b753496-fe75-4bfe-c109-f15451be730e",
@@ -476,7 +476,7 @@
476476
},
477477
{
478478
"cell_type": "code",
479-
"execution_count": 12,
479+
"execution_count": null,
480480
"metadata": {
481481
"id": "MrBzeB5LxBZU"
482482
},
@@ -504,7 +504,7 @@
504504
},
505505
{
506506
"cell_type": "code",
507-
"execution_count": 13,
507+
"execution_count": null,
508508
"metadata": {
509509
"id": "lJ6a5F28xBZU"
510510
},
@@ -525,7 +525,7 @@
525525
},
526526
{
527527
"cell_type": "code",
528-
"execution_count": 14,
528+
"execution_count": null,
529529
"metadata": {
530530
"id": "7UuJq5-JxBZV",
531531
"outputId": "0e3e73f9-caa5-441f-d8fd-8b854e4939d4",
@@ -568,7 +568,7 @@
568568
},
569569
{
570570
"cell_type": "code",
571-
"execution_count": 15,
571+
"execution_count": null,
572572
"metadata": {
573573
"id": "eWZGwVCGxBZW"
574574
},
@@ -590,7 +590,7 @@
590590
},
591591
{
592592
"cell_type": "code",
593-
"execution_count": 16,
593+
"execution_count": null,
594594
"metadata": {
595595
"id": "ulEw2VzLxBZY",
596596
"outputId": "3f6b91a8-cbec-424a-c8ea-d1089e5cc5c3",
@@ -633,7 +633,7 @@
633633
},
634634
{
635635
"cell_type": "code",
636-
"execution_count": 17,
636+
"execution_count": null,
637637
"metadata": {
638638
"id": "FoR9tig9xBZY",
639639
"outputId": "7ea64227-4ce1-4a8d-bb3f-2d2ef826a697",
@@ -660,9 +660,9 @@
660660
],
661661
"metadata": {
662662
"kernelspec": {
663-
"display_name": "training-pyhpc-2025",
664-
"language": "python",
665-
"name": "pyhpc-2025"
663+
"display_name": "training-pyhpc-2025",
664+
"language": "python",
665+
"name": "pyhpc-2025"
666666
},
667667
"language_info": {
668668
"codemirror_mode": {
@@ -684,4 +684,4 @@
684684
},
685685
"nbformat": 4,
686686
"nbformat_minor": 0
687-
}
687+
}

0 commit comments

Comments
 (0)