Skip to content

Commit 190c767

Browse files
committed
Added time unit (i.e. seconds) in timeit.timeit() in intro_to_graph notebook
1 parent 049852f commit 190c767

File tree

1 file changed

+114
-30
lines changed

1 file changed

+114
-30
lines changed

site/en/guide/intro_to_graphs.ipynb

Lines changed: 114 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"execution_count": null,
1515
"metadata": {
1616
"cellView": "form",
17-
"id": "yOYx6tzSnWQ3"
17+
"id": "yOYx6tzSnWQ3",
18+
"vscode": {
19+
"languageId": "python"
20+
}
1821
},
1922
"outputs": [],
2023
"source": [
@@ -157,7 +160,10 @@
157160
"cell_type": "code",
158161
"execution_count": null,
159162
"metadata": {
160-
"id": "goZwOXp_xyQj"
163+
"id": "goZwOXp_xyQj",
164+
"vscode": {
165+
"languageId": "python"
166+
}
161167
},
162168
"outputs": [],
163169
"source": [
@@ -181,7 +187,10 @@
181187
"cell_type": "code",
182188
"execution_count": null,
183189
"metadata": {
184-
"id": "HKbLeJ1y0Umi"
190+
"id": "HKbLeJ1y0Umi",
191+
"vscode": {
192+
"languageId": "python"
193+
}
185194
},
186195
"outputs": [],
187196
"source": [
@@ -227,7 +236,10 @@
227236
"cell_type": "code",
228237
"execution_count": null,
229238
"metadata": {
230-
"id": "rpz08iLplm9F"
239+
"id": "rpz08iLplm9F",
240+
"vscode": {
241+
"languageId": "python"
242+
}
231243
},
232244
"outputs": [],
233245
"source": [
@@ -273,7 +285,10 @@
273285
"cell_type": "code",
274286
"execution_count": null,
275287
"metadata": {
276-
"id": "PFObpff1BMEb"
288+
"id": "PFObpff1BMEb",
289+
"vscode": {
290+
"languageId": "python"
291+
}
277292
},
278293
"outputs": [],
279294
"source": [
@@ -303,7 +318,10 @@
303318
"cell_type": "code",
304319
"execution_count": null,
305320
"metadata": {
306-
"id": "lAKaat3w0gnn"
321+
"id": "lAKaat3w0gnn",
322+
"vscode": {
323+
"languageId": "python"
324+
}
307325
},
308326
"outputs": [],
309327
"source": [
@@ -315,7 +333,10 @@
315333
"cell_type": "code",
316334
"execution_count": null,
317335
"metadata": {
318-
"id": "8x6RAqza1UWf"
336+
"id": "8x6RAqza1UWf",
337+
"vscode": {
338+
"languageId": "python"
339+
}
319340
},
320341
"outputs": [],
321342
"source": [
@@ -351,7 +372,10 @@
351372
"cell_type": "code",
352373
"execution_count": null,
353374
"metadata": {
354-
"id": "LOASwhbvIv_T"
375+
"id": "LOASwhbvIv_T",
376+
"vscode": {
377+
"languageId": "python"
378+
}
355379
},
356380
"outputs": [],
357381
"source": [
@@ -378,7 +402,10 @@
378402
"cell_type": "code",
379403
"execution_count": null,
380404
"metadata": {
381-
"id": "TjjbnL5OKNDP"
405+
"id": "TjjbnL5OKNDP",
406+
"vscode": {
407+
"languageId": "python"
408+
}
382409
},
383410
"outputs": [],
384411
"source": [
@@ -400,7 +427,10 @@
400427
"cell_type": "code",
401428
"execution_count": null,
402429
"metadata": {
403-
"id": "dxzqebDYFmLy"
430+
"id": "dxzqebDYFmLy",
431+
"vscode": {
432+
"languageId": "python"
433+
}
404434
},
405435
"outputs": [],
406436
"source": [
@@ -435,7 +465,10 @@
435465
"cell_type": "code",
436466
"execution_count": null,
437467
"metadata": {
438-
"id": "_R0BOvBFxqVZ"
468+
"id": "_R0BOvBFxqVZ",
469+
"vscode": {
470+
"languageId": "python"
471+
}
439472
},
440473
"outputs": [],
441474
"source": [
@@ -449,7 +482,10 @@
449482
"cell_type": "code",
450483
"execution_count": null,
451484
"metadata": {
452-
"id": "zikMVPGhmDET"
485+
"id": "zikMVPGhmDET",
486+
"vscode": {
487+
"languageId": "python"
488+
}
453489
},
454490
"outputs": [],
455491
"source": [
@@ -463,7 +499,10 @@
463499
"cell_type": "code",
464500
"execution_count": null,
465501
"metadata": {
466-
"id": "07r08Dh158ft"
502+
"id": "07r08Dh158ft",
503+
"vscode": {
504+
"languageId": "python"
505+
}
467506
},
468507
"outputs": [],
469508
"source": [
@@ -483,7 +522,10 @@
483522
"cell_type": "code",
484523
"execution_count": null,
485524
"metadata": {
486-
"id": "lKoF6NjPoI8w"
525+
"id": "lKoF6NjPoI8w",
526+
"vscode": {
527+
"languageId": "python"
528+
}
487529
},
488530
"outputs": [],
489531
"source": [
@@ -494,7 +536,10 @@
494536
"cell_type": "code",
495537
"execution_count": null,
496538
"metadata": {
497-
"id": "9ZLqTyn0oKeM"
539+
"id": "9ZLqTyn0oKeM",
540+
"vscode": {
541+
"languageId": "python"
542+
}
498543
},
499544
"outputs": [],
500545
"source": [
@@ -505,7 +550,10 @@
505550
"cell_type": "code",
506551
"execution_count": null,
507552
"metadata": {
508-
"id": "cV7daQW9odn-"
553+
"id": "cV7daQW9odn-",
554+
"vscode": {
555+
"languageId": "python"
556+
}
509557
},
510558
"outputs": [],
511559
"source": [
@@ -526,7 +574,10 @@
526574
"cell_type": "code",
527575
"execution_count": null,
528576
"metadata": {
529-
"id": "BEJeVeBEoGjV"
577+
"id": "BEJeVeBEoGjV",
578+
"vscode": {
579+
"languageId": "python"
580+
}
530581
},
531582
"outputs": [],
532583
"source": [
@@ -550,7 +601,10 @@
550601
"cell_type": "code",
551602
"execution_count": null,
552603
"metadata": {
553-
"id": "3rJIeBg72T9n"
604+
"id": "3rJIeBg72T9n",
605+
"vscode": {
606+
"languageId": "python"
607+
}
554608
},
555609
"outputs": [],
556610
"source": [
@@ -576,7 +630,10 @@
576630
"cell_type": "code",
577631
"execution_count": null,
578632
"metadata": {
579-
"id": "oFSxRtcptYpe"
633+
"id": "oFSxRtcptYpe",
634+
"vscode": {
635+
"languageId": "python"
636+
}
580637
},
581638
"outputs": [],
582639
"source": [
@@ -588,7 +645,10 @@
588645
"cell_type": "code",
589646
"execution_count": null,
590647
"metadata": {
591-
"id": "qYxrAtvzNgHR"
648+
"id": "qYxrAtvzNgHR",
649+
"vscode": {
650+
"languageId": "python"
651+
}
592652
},
593653
"outputs": [],
594654
"source": [
@@ -602,7 +662,10 @@
602662
"cell_type": "code",
603663
"execution_count": null,
604664
"metadata": {
605-
"id": "_Df6ynXcAaup"
665+
"id": "_Df6ynXcAaup",
666+
"vscode": {
667+
"languageId": "python"
668+
}
606669
},
607670
"outputs": [],
608671
"source": [
@@ -656,7 +719,10 @@
656719
"cell_type": "code",
657720
"execution_count": null,
658721
"metadata": {
659-
"id": "OdN0nKlUwj7M"
722+
"id": "OdN0nKlUwj7M",
723+
"vscode": {
724+
"languageId": "python"
725+
}
660726
},
661727
"outputs": [],
662728
"source": [
@@ -676,7 +742,10 @@
676742
"cell_type": "code",
677743
"execution_count": null,
678744
"metadata": {
679-
"id": "d80Fob4MwhTs"
745+
"id": "d80Fob4MwhTs",
746+
"vscode": {
747+
"languageId": "python"
748+
}
680749
},
681750
"outputs": [],
682751
"source": [
@@ -730,7 +799,10 @@
730799
"cell_type": "code",
731800
"execution_count": null,
732801
"metadata": {
733-
"id": "jr7p1BBjauPK"
802+
"id": "jr7p1BBjauPK",
803+
"vscode": {
804+
"languageId": "python"
805+
}
734806
},
735807
"outputs": [],
736808
"source": [
@@ -747,23 +819,29 @@
747819
"cell_type": "code",
748820
"execution_count": null,
749821
"metadata": {
750-
"id": "ms2yJyAnUYxK"
822+
"id": "ms2yJyAnUYxK",
823+
"vscode": {
824+
"languageId": "python"
825+
}
751826
},
752827
"outputs": [],
753828
"source": [
754-
"print(\"Eager execution:\", timeit.timeit(lambda: power(x, 100), number=1000))"
829+
"print(\"Eager execution:\", timeit.timeit(lambda: power(x, 100), number=1000), \"seconds\")"
755830
]
756831
},
757832
{
758833
"cell_type": "code",
759834
"execution_count": null,
760835
"metadata": {
761-
"id": "gUB2mTyRYRAe"
836+
"id": "gUB2mTyRYRAe",
837+
"vscode": {
838+
"languageId": "python"
839+
}
762840
},
763841
"outputs": [],
764842
"source": [
765843
"power_as_graph = tf.function(power)\n",
766-
"print(\"Graph execution:\", timeit.timeit(lambda: power_as_graph(x, 100), number=1000))"
844+
"print(\"Graph execution:\", timeit.timeit(lambda: power_as_graph(x, 100), number=1000), \"seconds\")"
767845
]
768846
},
769847
{
@@ -805,7 +883,10 @@
805883
"cell_type": "code",
806884
"execution_count": null,
807885
"metadata": {
808-
"id": "hXtwlbpofLgW"
886+
"id": "hXtwlbpofLgW",
887+
"vscode": {
888+
"languageId": "python"
889+
}
809890
},
810891
"outputs": [],
811892
"source": [
@@ -824,7 +905,10 @@
824905
"cell_type": "code",
825906
"execution_count": null,
826907
"metadata": {
827-
"id": "inzSg8yzfNjl"
908+
"id": "inzSg8yzfNjl",
909+
"vscode": {
910+
"languageId": "python"
911+
}
828912
},
829913
"outputs": [],
830914
"source": [

0 commit comments

Comments
 (0)