File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 55
66import torch
77from timed_decorator .simple_timed import timed
8- from torch import GradScaler , Tensor , nn
8+ from torch import GradScaler , Tensor
99from torch .backends import cudnn
1010from torch .nn .utils import clip_grad_norm_
1111from torch .utils .tensorboard import SummaryWriter
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ def forward(self, x: Tensor) -> Tensor:
3939class StepCompose (v2 .Compose ):
4040 def __init__ (self , transforms : Sequence [Callable ]):
4141 super ().__init__ (transforms )
42- self .need_step = [x for x in self .transforms if hasattr (x , "step" )]
4342
4443 def init (self , x : Tensor ) -> Tensor :
4544 for transform in self .transforms :
@@ -126,14 +125,13 @@ def train_cached(self):
126125 [
127126 v2 .ToImage (),
128127 v2 .ToDtype (torch .float32 , scale = True ),
128+ v2 .Pad (padding = 4 , fill = 0 if self .args .fill is None else self .args .fill )
129129 ]
130130 )
131131
132132 def train_runtime (self ):
133133 transforms = [
134- v2 .RandomCrop (
135- 32 , padding = 4 , fill = 0 if self .args .fill is None else self .args .fill
136- ),
134+ v2 .RandomCrop (32 ),
137135 ]
138136
139137 if self .args .autoaug :
You can’t perform that action at this time.
0 commit comments