Skip to content

Commit fae9374

Browse files
authored
Merge branch 'main' into find_private
2 parents d9cde34 + bdfb790 commit fae9374

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/transforms/autoaugment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ def forward(self, img: Tensor) -> Tensor:
268268

269269
transform_id, probs, signs = self.get_params(len(self.policies))
270270

271+
op_meta = self._augmentation_space(10, F.get_image_size(img))
271272
for i, (op_name, p, magnitude_id) in enumerate(self.policies[transform_id]):
272273
if probs[i] <= p:
273-
op_meta = self._augmentation_space(10, F.get_image_size(img))
274274
magnitudes, signed = op_meta[op_name]
275275
magnitude = float(magnitudes[magnitude_id].item()) if magnitude_id is not None else 0.0
276276
if signed and signs[i] == 0:
@@ -350,8 +350,8 @@ def forward(self, img: Tensor) -> Tensor:
350350
elif fill is not None:
351351
fill = [float(f) for f in fill]
352352

353+
op_meta = self._augmentation_space(self.num_magnitude_bins, F.get_image_size(img))
353354
for _ in range(self.num_ops):
354-
op_meta = self._augmentation_space(self.num_magnitude_bins, F.get_image_size(img))
355355
op_index = int(torch.randint(len(op_meta), (1,)).item())
356356
op_name = list(op_meta.keys())[op_index]
357357
magnitudes, signed = op_meta[op_name]

0 commit comments

Comments
 (0)