Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

Fixed typing (#1148)

Jian Shidd03a6b45c68
diff --git a/kornia/augmentation/container/patch.py b/kornia/augmentation/container/patch.py
index a257a8318..6b84b9ed9 100644
--- a/kornia/augmentation/container/patch.py
+++ b/kornia/augmentation/container/patch.py
@@ -262,20 +262,20 @@ class PatchSequential(ImageSequential):
with_mix = mix_added
for s in seq:
if isinstance(s[1], (_AugmentationBase, MixAugmentationBase, SequentialBase)):
- yield ParamItem(s[0], s[1].forward_parameters(batch_shape[1:])), i
+ yield ParamItem(s[0], s[1].forward_parameters(torch.Size(batch_shape[1:]))), i
else:
yield ParamItem(s[0], None), i
elif not self.same_on_batch and not self.random_apply:
for i, nchild in enumerate(self.named_children()):
if isinstance(nchild[1], (_AugmentationBase, MixAugmentationBase, SequentialBase)):
- yield ParamItem(nchild[0], nchild[1].forward_parameters(batch_shape[1:])), i
+ yield ParamItem(nchild[0], nchild[1].forward_parameters(torch.Size(batch_shape[1:]))), i
else:
yield ParamItem(nchild[0], None), i
elif not self.random_apply:
# same_on_batch + not random_apply => location-wise augmentation
for i, nchild in enumerate(islice(cycle(self.named_children()), batch_shape[0])):
if isinstance(nchild[1], (_AugmentationBase, MixAugmentationBase, SequentialBase)):
- yield ParamItem(nchild[0], nchild[1].forward_parameters(batch_shape[1:])), i
+ yield ParamItem(nchild[0], nchild[1].forward_parameters(torch.Size(batch_shape[1:]))), i
else:
yield ParamItem(nchild[0], None), i
else:
@@ -286,7 +286,7 @@ class PatchSequential(ImageSequential):
with_mix = mix_added
for s in seq:
if isinstance(s[1], (_AugmentationBase, MixAugmentationBase, SequentialBase)):
- yield ParamItem(s[0], s[1].forward_parameters(batch_shape[1:])), i
+ yield ParamItem(s[0], s[1].forward_parameters(torch.Size(batch_shape[1:]))), i
else:
yield ParamItem(s[0], None), i