mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
update Docs [links & formatting] (#769)
* wip * wip * debug imports docs formatting * WIP * formatting * fix setup
This commit is contained in:
@@ -7,8 +7,8 @@ from argparse import ArgumentParser
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
import pytorch_lightning as pl
|
||||
from pl_examples.basic_examples.lightning_module_template import LightningTemplateModel
|
||||
from pytorch_lightning import Trainer
|
||||
|
||||
SEED = 2334
|
||||
torch.manual_seed(SEED)
|
||||
@@ -28,7 +28,7 @@ def main(hparams):
|
||||
# ------------------------
|
||||
# 2 INIT TRAINER
|
||||
# ------------------------
|
||||
trainer = Trainer()
|
||||
trainer = pl.Trainer()
|
||||
|
||||
# ------------------------
|
||||
# 3 START TRAINING
|
||||
|
||||
@@ -7,8 +7,8 @@ from argparse import ArgumentParser
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
import pytorch_lightning as pl
|
||||
from pl_examples.basic_examples.lightning_module_template import LightningTemplateModel
|
||||
from pytorch_lightning import Trainer
|
||||
|
||||
SEED = 2334
|
||||
torch.manual_seed(SEED)
|
||||
@@ -28,7 +28,7 @@ def main(hparams):
|
||||
# ------------------------
|
||||
# 2 INIT TRAINER
|
||||
# ------------------------
|
||||
trainer = Trainer(
|
||||
trainer = pl.Trainer(
|
||||
gpus=hparams.gpus,
|
||||
distributed_backend=hparams.distributed_backend,
|
||||
use_amp=hparams.use_16bit
|
||||
|
||||
@@ -16,10 +16,9 @@ from torch.utils.data.distributed import DistributedSampler
|
||||
from torchvision.datasets import MNIST
|
||||
|
||||
import pytorch_lightning as pl
|
||||
from pytorch_lightning.core.lightning import LightningModule
|
||||
|
||||
|
||||
class LightningTemplateModel(LightningModule):
|
||||
class LightningTemplateModel(pl.LightningModule):
|
||||
"""
|
||||
Sample model to show how to define a template
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user