Skip to content

Commit 1068abe

Browse files
authored
[BE] Delete from __future__ import (#2429)
As Python-2.7 is long past EOL, and all tutorials are living in the future :)
1 parent 121f71a commit 1068abe

14 files changed

+0
-28
lines changed

advanced_source/cpp_frontend.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,9 +1216,6 @@ tensors and display them with matplotlib:
12161216
12171217
.. code-block:: python
12181218
1219-
from __future__ import print_function
1220-
from __future__ import unicode_literals
1221-
12221219
import argparse
12231220
12241221
import matplotlib.pyplot as plt

advanced_source/neural_style_tutorial.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
# - ``torchvision.models`` (train or load pretrained models)
4848
# - ``copy`` (to deep copy the models; system package)
4949

50-
from __future__ import print_function
51-
5250
import torch
5351
import torch.nn as nn
5452
import torch.nn.functional as F

beginner_source/chatbot_tutorial.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@
9292
# After that, let’s import some necessities.
9393
#
9494

95-
from __future__ import absolute_import
96-
from __future__ import division
97-
from __future__ import print_function
98-
from __future__ import unicode_literals
99-
10095
import torch
10196
from torch.jit import script, trace
10297
import torch.nn as nn

beginner_source/data_loading_tutorial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
1919
"""
2020

21-
from __future__ import print_function, division
2221
import os
2322
import torch
2423
import pandas as pd

beginner_source/deploy_seq2seq_hybrid_frontend_tutorial.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@
101101
# maximum length output that the model is capable of producing.
102102
#
103103

104-
from __future__ import absolute_import
105-
from __future__ import division
106-
from __future__ import print_function
107-
from __future__ import unicode_literals
108-
109104
import torch
110105
import torch.nn as nn
111106
import torch.nn.functional as F

beginner_source/fgsm_tutorial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
# into the implementation.
9191
#
9292

93-
from __future__ import print_function
9493
import torch
9594
import torch.nn as nn
9695
import torch.nn.functional as F

beginner_source/transfer_learning_tutorial.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
# License: BSD
3434
# Author: Sasank Chilamkurthy
3535

36-
from __future__ import print_function, division
37-
3836
import torch
3937
import torch.nn as nn
4038
import torch.optim as optim

intermediate_source/char_rnn_classification_tutorial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
``{language: [names ...]}``. The generic variables "category" and "line"
7575
(for language and name in our case) are used for later extensibility.
7676
"""
77-
from __future__ import unicode_literals, print_function, division
7877
from io import open
7978
import glob
8079
import os

intermediate_source/char_rnn_generation_tutorial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
and end up with a dictionary ``{language: [names ...]}``.
7676
7777
"""
78-
from __future__ import unicode_literals, print_function, division
7978
from io import open
8079
import glob
8180
import os

intermediate_source/dynamic_quantization_bert_tutorial.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ In this step we import the necessary Python modules for the tutorial.
9292

9393
.. code:: python
9494
95-
from __future__ import absolute_import, division, print_function
96-
9795
import logging
9896
import numpy as np
9997
import os

intermediate_source/seq2seq_translation_tutorial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
7979
**Requirements**
8080
"""
81-
from __future__ import unicode_literals, print_function, division
8281
from io import open
8382
import unicodedata
8483
import string

intermediate_source/spatial_transformer_tutorial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
# License: BSD
2828
# Author: Ghassen Hamrouni
2929

30-
from __future__ import print_function
3130
import torch
3231
import torch.nn as nn
3332
import torch.nn.functional as F

prototype_source/graph_mode_dynamic_bert_tutorial.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ Once all the necesessary packages are downloaded and installed we setup the code
4040

4141
.. code:: python
4242
43-
from __future__ import absolute_import, division, print_function
44-
4543
import logging
4644
import numpy as np
4745
import os

prototype_source/numeric_suite_tutorial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
##############################################################################
2626

27-
from __future__ import print_function, division, absolute_import
2827
import numpy as np
2928
import torch
3029
import torch.nn as nn

0 commit comments

Comments
 (0)