wdtypes.py 995 字节
Newer Older
J
jrzaurin 已提交
1
import sys
2 3
import scipy

J
jrzaurin 已提交
4
from torch.nn import Module
5
from torch import Tensor
J
jrzaurin 已提交
6
from torchvision.transforms import *
7 8 9 10
from torch.optim.optimizer import Optimizer
from torch.utils.data.dataloader import DataLoader
from torch.optim.lr_scheduler import _LRScheduler
from pathlib import PosixPath
11 12
from typing import (List, Any, Union, Dict, Callable, Optional, Tuple,
	Generator, Collection, Iterable)
J
jrzaurin 已提交
13

14 15 16

sparse_matrix = Union[scipy.sparse.csr.csr_matrix]

J
jrzaurin 已提交
17 18 19
SimpleNamespace = type(sys.implementation)
ListRules = Collection[Callable[[str],str]]
Tokens = Collection[Collection[str]]
20

J
jrzaurin 已提交
21 22 23 24 25 26
Transforms= Union[CenterCrop, ColorJitter, Compose, FiveCrop, Grayscale,
	Lambda, LinearTransformation, Normalize, Pad, RandomAffine,
	RandomApply, RandomChoice, RandomCrop, RandomGrayscale,
	RandomHorizontalFlip, RandomOrder, RandomResizedCrop, RandomRotation,
	RandomSizedCrop, RandomVerticalFlip, Resize, Scale, TenCrop,
	ToPILImage, ToTensor]
27

28
LRScheduler = _LRScheduler
J
jrzaurin 已提交
29
ModelParams = Generator[Tensor,Tensor,Tensor]