|
97 | 97 | " _index_sampler,generator,prefetch_factor = Inf.count,None,2\n",
|
98 | 98 | " dataset_kind = _dataset_kind = _DatasetKind.Iterable\n",
|
99 | 99 | " \n",
|
100 |
| - " def __init__(self, d, pin_memory, num_workers, timeout, persistent_workers):\n", |
101 |
| - " self.dataset,self.default,self.worker_init_fn = self,d,_wif\n", |
102 |
| - " store_attr('d,pin_memory,num_workers,timeout,persistent_workers')\n", |
| 100 | + " def __init__(self, d, pin_memory, num_workers, timeout, persistent_workers,pin_memory_device):\n", |
| 101 | + " self.dataset,self.default,self.worker_init_fn,self.pin_memory_device = self,d,_wif,pin_memory_device\n", |
| 102 | + " store_attr('d,pin_memory,num_workers,timeout,persistent_workers,pin_memory_device')\n", |
103 | 103 | "\n",
|
104 | 104 | " def __iter__(self): return iter(self.d.create_batches(self.d.sample()))\n",
|
105 | 105 | "\n",
|
|
274 | 274 | " get_idxs sample shuffle_fn do_batch create_batch'.split()\n",
|
275 | 275 | " _default = 'dataset'\n",
|
276 | 276 | " def __init__(self, dataset=None, bs=None, num_workers=0, pin_memory=False, timeout=0, batch_size=None,\n",
|
277 |
| - " shuffle=False, drop_last=False, indexed=None, n=None, device=None, persistent_workers=False, **kwargs):\n", |
| 277 | + " shuffle=False, drop_last=False, indexed=None, n=None, device=None, persistent_workers=False,\n", |
| 278 | + " pin_memory_device='', **kwargs):\n", |
278 | 279 | " if batch_size is not None: bs = batch_size # PyTorch compatibility\n",
|
279 | 280 | " assert not (bs is None and drop_last)\n",
|
280 | 281 | " if indexed is None: indexed = (hasattr(dataset,'__getitem__')\n",
|
|
289 | 290 | " print(\"Due to IPython and Windows limitation, python multiprocessing isn't available now.\")\n",
|
290 | 291 | " print(\"So `number_workers` is changed to 0 to avoid getting stuck\")\n",
|
291 | 292 | " num_workers = 0 \n",
|
292 |
| - " self.fake_l = _FakeLoader(self, pin_memory, num_workers, timeout, persistent_workers=persistent_workers)\n", |
| 293 | + " self.fake_l = _FakeLoader(self, pin_memory, num_workers, timeout, persistent_workers=persistent_workers,\n", |
| 294 | + " pin_memory_device=pin_memory_device)\n", |
293 | 295 | "\n",
|
294 | 296 | " def __len__(self):\n",
|
295 | 297 | " if self.n is None: raise TypeError\n",
|
|
423 | 425 | {
|
424 | 426 | "data": {
|
425 | 427 | "text/plain": [
|
426 |
| - "(#40) [0.6220516703202649,0.38347354268972134,0.36273911288359706,0.4314958642862322,0.48170868503127295,0.1755075234373844,0.26036103499878493,0.16037428323147251,0.8350911770957413,0.4347179239514216...]" |
| 428 | + "(#0) []" |
427 | 429 | ]
|
428 | 430 | },
|
429 | 431 | "execution_count": null,
|
|
448 | 450 | {
|
449 | 451 | "data": {
|
450 | 452 | "text/plain": [
|
451 |
| - "(#1) [4]" |
| 453 | + "(#11) [4,4,4,4,4,4,4,4,4,4...]" |
452 | 454 | ]
|
453 | 455 | },
|
454 | 456 | "execution_count": null,
|
|
468 | 470 | {
|
469 | 471 | "data": {
|
470 | 472 | "text/plain": [
|
471 |
| - "(#21) [4,4,4,4,4,4,4,4,4,4...]" |
| 473 | + "(#10) [4,4,4,4,4,4,4,4,4,4]" |
472 | 474 | ]
|
473 | 475 | },
|
474 | 476 | "execution_count": null,
|
|
503 | 505 | {
|
504 | 506 | "data": {
|
505 | 507 | "text/plain": [
|
506 |
| - "(#2) [0.6192763059885179,0.33021254121031707]" |
| 508 | + "(#7) [0.41917548410987093,0.5197100010284023,0.7706771870574884,0.6479314353871329,0.43661079462005437,0.6094953292136542,0.4985993416362957]" |
507 | 509 | ]
|
508 | 510 | },
|
509 | 511 | "execution_count": null,
|
|
631 | 633 | "name": "stdout",
|
632 | 634 | "output_type": "stream",
|
633 | 635 | "text": [
|
634 |
| - "CPU times: user 4.27 ms, sys: 1.05 ms, total: 5.32 ms\n", |
635 |
| - "Wall time: 316 ms\n", |
636 |
| - "CPU times: user 12.7 ms, sys: 11.9 ms, total: 24.5 ms\n", |
637 |
| - "Wall time: 197 ms\n", |
638 |
| - "CPU times: user 14.5 ms, sys: 16.2 ms, total: 30.7 ms\n", |
639 |
| - "Wall time: 127 ms\n" |
| 636 | + "CPU times: user 6.97 ms, sys: 0 ns, total: 6.97 ms\n", |
| 637 | + "Wall time: 309 ms\n", |
| 638 | + "CPU times: user 12.2 ms, sys: 12.8 ms, total: 25 ms\n", |
| 639 | + "Wall time: 277 ms\n", |
| 640 | + "CPU times: user 21.9 ms, sys: 23.9 ms, total: 45.7 ms\n", |
| 641 | + "Wall time: 325 ms\n" |
640 | 642 | ]
|
641 | 643 | },
|
642 | 644 | {
|
643 | 645 | "data": {
|
644 | 646 | "text/plain": [
|
645 |
| - "(#26) ['r','c','q','n','j','s','l','p','b','y'...]" |
| 647 | + "(#26) ['i','x','t','y','p','u','j','n','f','k'...]" |
646 | 648 | ]
|
647 | 649 | },
|
648 | 650 | "execution_count": null,
|
|
677 | 679 | "name": "stdout",
|
678 | 680 | "output_type": "stream",
|
679 | 681 | "text": [
|
680 |
| - "CPU times: user 12 ms, sys: 22.3 ms, total: 34.3 ms\n", |
681 |
| - "Wall time: 130 ms\n" |
| 682 | + "CPU times: user 19 ms, sys: 22.1 ms, total: 41 ms\n", |
| 683 | + "Wall time: 295 ms\n" |
682 | 684 | ]
|
683 | 685 | }
|
684 | 686 | ],
|
|
728 | 730 | {
|
729 | 731 | "data": {
|
730 | 732 | "text/plain": [
|
731 |
| - "[tensor([16, 14, 5, 1, 39, 49, 10, 40, 7, 36, 28, 42, 32, 24, 43, 46, 4, 3,\n", |
732 |
| - " 11, 48, 26, 35, 15, 25, 23, 8, 44, 47, 0, 34, 21, 17]),\n", |
733 |
| - " tensor([45, 41, 6, 20, 38, 19, 29, 37, 13, 18, 2, 27, 30, 12, 33, 22, 9, 31])]" |
| 733 | + "[tensor([29, 10, 19, 23, 36, 5, 31, 1, 40, 22, 24, 47, 34, 9, 2, 33, 39, 30,\n", |
| 734 | + " 42, 49, 14, 17, 18, 35, 15, 27, 13, 48, 3, 32, 4, 8]),\n", |
| 735 | + " tensor([11, 25, 45, 28, 38, 7, 6, 37, 44, 0, 26, 12, 41, 43, 21, 16, 20, 46])]" |
734 | 736 | ]
|
735 | 737 | },
|
736 | 738 | "execution_count": null,
|
|
831 | 833 | "Converted 21_vision.learner.ipynb.\n",
|
832 | 834 | "Converted 22_tutorial.imagenette.ipynb.\n",
|
833 | 835 | "Converted 23_tutorial.vision.ipynb.\n",
|
| 836 | + "Converted 24_tutorial.image_sequence.ipynb.\n", |
834 | 837 | "Converted 24_tutorial.siamese.ipynb.\n",
|
835 | 838 | "Converted 24_vision.gan.ipynb.\n",
|
836 | 839 | "Converted 30_text.core.ipynb.\n",
|
|
839 | 842 | "Converted 33_text.models.core.ipynb.\n",
|
840 | 843 | "Converted 34_callback.rnn.ipynb.\n",
|
841 | 844 | "Converted 35_tutorial.wikitext.ipynb.\n",
|
842 |
| - "Converted 36_text.models.qrnn.ipynb.\n", |
843 | 845 | "Converted 37_text.learner.ipynb.\n",
|
844 | 846 | "Converted 38_tutorial.text.ipynb.\n",
|
845 | 847 | "Converted 39_tutorial.transformers.ipynb.\n",
|
|
858 | 860 | "Converted 71_callback.tensorboard.ipynb.\n",
|
859 | 861 | "Converted 72_callback.neptune.ipynb.\n",
|
860 | 862 | "Converted 73_callback.captum.ipynb.\n",
|
861 |
| - "Converted 74_callback.azureml.ipynb.\n", |
| 863 | + "Converted 74_huggingface.ipynb.\n", |
862 | 864 | "Converted 97_test_utils.ipynb.\n",
|
863 | 865 | "Converted 99_pytorch_doc.ipynb.\n",
|
864 | 866 | "Converted dev-setup.ipynb.\n",
|
|
868 | 870 | "Converted migrating_ignite.ipynb.\n",
|
869 | 871 | "Converted migrating_lightning.ipynb.\n",
|
870 | 872 | "Converted migrating_pytorch.ipynb.\n",
|
| 873 | + "Converted migrating_pytorch_verbose.ipynb.\n", |
871 | 874 | "Converted ulmfit.ipynb.\n",
|
872 | 875 | "Converted index.ipynb.\n",
|
873 | 876 | "Converted quick_start.ipynb.\n",
|
|
0 commit comments