mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-11 12:31:23 +08:00
Minor imports cleaning (#402)
* code cleaning * drop unused imports * optimize imports
This commit is contained in:
committed by
William Falcon
parent
e6e325c853
commit
f18aee30a5
@@ -2,12 +2,13 @@
|
||||
Runs a model on a single node across N-gpus.
|
||||
"""
|
||||
import os
|
||||
from argparse import ArgumentParser
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from pytorch_lightning import Trainer
|
||||
from pl_examples.basic_examples.lightning_module_template import LightningTemplateModel
|
||||
from pytorch_lightning import Trainer
|
||||
|
||||
SEED = 2334
|
||||
torch.manual_seed(SEED)
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
Runs a model on a single node across N-gpus.
|
||||
"""
|
||||
import os
|
||||
from argparse import ArgumentParser
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from pytorch_lightning import Trainer
|
||||
from pl_examples.basic_examples.lightning_module_template import LightningTemplateModel
|
||||
from pytorch_lightning import Trainer
|
||||
|
||||
SEED = 2334
|
||||
torch.manual_seed(SEED)
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
Example template for defining a system
|
||||
"""
|
||||
import os
|
||||
from collections import OrderedDict
|
||||
import torch.nn as nn
|
||||
from torchvision.datasets import MNIST
|
||||
import torchvision.transforms as transforms
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
from argparse import ArgumentParser
|
||||
from collections import OrderedDict
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.nn.functional as F
|
||||
import torchvision.transforms as transforms
|
||||
from torch import optim
|
||||
from torch.utils.data import DataLoader
|
||||
from torch.utils.data.distributed import DistributedSampler
|
||||
from torchvision.datasets import MNIST
|
||||
|
||||
import pytorch_lightning as pl
|
||||
from pytorch_lightning.root_module.root_module import LightningModule
|
||||
|
||||
@@ -6,20 +6,18 @@ After a few epochs, launch tensorboard to see the images being generated at ever
|
||||
|
||||
tensorboard --logdir default
|
||||
"""
|
||||
from argparse import ArgumentParser
|
||||
import os
|
||||
import numpy as np
|
||||
from argparse import ArgumentParser
|
||||
from collections import OrderedDict
|
||||
|
||||
import torchvision
|
||||
import torchvision.transforms as transforms
|
||||
from torchvision.datasets import MNIST
|
||||
|
||||
from torch.utils.data import DataLoader
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.nn.functional as F
|
||||
import torch
|
||||
import torchvision
|
||||
import torchvision.transforms as transforms
|
||||
from torch.utils.data import DataLoader
|
||||
from torchvision.datasets import MNIST
|
||||
|
||||
import pytorch_lightning as pl
|
||||
|
||||
@@ -178,7 +176,6 @@ class GAN(pl.LightningModule):
|
||||
|
||||
|
||||
def main(hparams):
|
||||
|
||||
# ------------------------
|
||||
# 1 INIT LIGHTNING MODEL
|
||||
# ------------------------
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
Multi-node example (GPU)
|
||||
"""
|
||||
import os
|
||||
from argparse import ArgumentParser
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from pytorch_lightning import Trainer
|
||||
from pl_examples.basic_examples.lightning_module_template import LightningTemplateModel
|
||||
from pytorch_lightning import Trainer
|
||||
|
||||
SEED = 2334
|
||||
torch.manual_seed(SEED)
|
||||
@@ -41,7 +42,6 @@ def main(hparams):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
root_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
parent_parser = ArgumentParser(add_help=False)
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
Multi-node example (GPU)
|
||||
"""
|
||||
import os
|
||||
from argparse import ArgumentParser
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from pytorch_lightning import Trainer
|
||||
from pl_examples.basic_examples.lightning_module_template import LightningTemplateModel
|
||||
from pytorch_lightning import Trainer
|
||||
|
||||
SEED = 2334
|
||||
torch.manual_seed(SEED)
|
||||
@@ -41,7 +42,6 @@ def main(hparams):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
root_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
parent_parser = ArgumentParser(add_help=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user