Skip to content

Commit f6d77c3

Browse files
committed
cleanup some unused imports
1 parent 1b70252 commit f6d77c3

File tree

8 files changed

+16
-37
lines changed

8 files changed

+16
-37
lines changed

labml_nn/cfr/kuhn/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
from labml import experiment
4242
from labml.configs import option
4343
from labml_nn.cfr import History as _History, InfoSet as _InfoSet, Action, Player, CFRConfigs
44-
from labml_nn.cfr.infoset_saver import InfoSetSaver
4544

4645
# Kuhn poker actions are pass (`p`) or bet (`b`)
4746
ACTIONS = cast(List[Action], ['p', 'b'])

labml_nn/diffusion/ddpm/experiment.ipynb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@
7171
}
7272
},
7373
"source": [
74-
"import torch\n",
75-
"import torch.nn as nn\n",
76-
"\n",
7774
"from labml import experiment\n",
78-
"from labml.configs import option\n",
7975
"from labml_nn.diffusion.ddpm.experiment import Configs"
8076
],
8177
"outputs": [],

labml_nn/normalization/deep_norm/experiment.ipynb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,7 @@
6868
}
6969
},
7070
"source": [
71-
"import torch\n",
72-
"import torch.nn as nn\n",
73-
"\n",
7471
"from labml import experiment\n",
75-
"from labml.configs import option\n",
7672
"from labml_nn.normalization.deep_norm.experiment import Configs"
7773
],
7874
"outputs": [],

labml_nn/normalization/weight_standardization/experiment.ipynb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@
5353
"id": "0hJXx_g0wS2C"
5454
},
5555
"source": [
56-
"import torch\n",
57-
"import torch.nn as nn\n",
58-
"\n",
5956
"from labml import experiment\n",
6057
"from labml_nn.normalization.weight_standardization.experiment import CIFAR10Configs as Configs"
6158
],

labml_nn/rl/ppo/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"""
2727

2828
import torch
29-
3029
from labml_nn.rl.ppo.gae import GAE
30+
from torch import nn
3131

3232

3333
class ClippedPPOLoss(nn.Module):
@@ -178,7 +178,7 @@ def forward(self, log_pi: torch.Tensor, sampled_log_pi: torch.Tensor,
178178
return -policy_reward.mean()
179179

180180

181-
class ClippedValueFunctionLoss(Module):
181+
class ClippedValueFunctionLoss(nn.Module):
182182
"""
183183
## Clipped Value Function Loss
184184

labml_nn/transformers/basic/autoregressive_experiment.ipynb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@
7171
}
7272
},
7373
"source": [
74-
"import torch\n",
75-
"import torch.nn as nn\n",
76-
"\n",
7774
"from labml import experiment\n",
78-
"from labml.configs import option\n",
7975
"from labml_nn.transformers.basic.autoregressive_experiment import Configs"
8076
],
8177
"outputs": [],

labml_nn/transformers/fast_weights/experiment.ipynb

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@
6767
"id": "0hJXx_g0wS2C"
6868
},
6969
"source": [
70-
"import torch\n",
71-
"import torch.nn as nn\n",
72-
"\n",
7370
"from labml import experiment\n",
74-
"from labml.configs import option\n",
7571
"from labml_nn.transformers.fast_weights.experiment import Configs"
7672
],
7773
"outputs": [],
@@ -138,21 +134,21 @@
138134
},
139135
"source": [
140136
"experiment.configs(conf,\n",
141-
" # A dictionary of configurations to override\n",
142-
" {'tokenizer': 'character',\n",
143-
" 'text': 'tiny_shakespeare',\n",
144-
" 'optimizer.learning_rate': 1.0,\n",
145-
" 'optimizer.optimizer': 'Noam',\n",
146-
" 'prompt': 'It is',\n",
147-
" 'prompt_separator': '',\n",
137+
" # A dictionary of configurations to override\n",
138+
" {'tokenizer': 'character',\n",
139+
" 'text': 'tiny_shakespeare',\n",
140+
" 'optimizer.learning_rate': 1.0,\n",
141+
" 'optimizer.optimizer': 'Noam',\n",
142+
" 'prompt': 'It is',\n",
143+
" 'prompt_separator': '',\n",
148144
"\n",
149-
" 'train_loader': 'shuffled_train_loader',\n",
150-
" 'valid_loader': 'shuffled_valid_loader',\n",
145+
" 'train_loader': 'shuffled_train_loader',\n",
146+
" 'valid_loader': 'shuffled_valid_loader',\n",
151147
"\n",
152-
" 'seq_len': 128,\n",
153-
" 'epochs': 128,\n",
154-
" 'batch_size': 16,\n",
155-
" 'inner_iterations': 25})"
148+
" 'seq_len': 128,\n",
149+
" 'epochs': 128,\n",
150+
" 'batch_size': 16,\n",
151+
" 'inner_iterations': 25})"
156152
],
157153
"outputs": [],
158154
"execution_count": null

labml_nn/unet/carvana.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
Save the training images inside `carvana/train` folder and the masks in `carvana/train_masks` folder.
1414
"""
1515

16-
from torch import nn
1716
from pathlib import Path
1817

19-
import torch.utils.data
2018
import torchvision.transforms.functional
2119
from PIL import Image
2220

21+
import torch.utils.data
2322
from labml import lab
2423

2524

0 commit comments

Comments
 (0)