Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

docs(augmentation): PatchSequential under torch.compile returns wrong values before torch 2.15 (#6198)

Dmytro Mishkin612f3c3835ca
diff --git a/kornia/augmentation/container/patch.py b/kornia/augmentation/container/patch.py
index 5401d7983..f82eb412b 100644
--- a/kornia/augmentation/container/patch.py
+++ b/kornia/augmentation/container/patch.py
@@ -118,6 +118,12 @@ class PatchSequential(ImageSequential):
.. note::
See a working example `here <https://www.kornia.org/tutorials/nbs/data_patch_sequential.html>`__.
+ .. warning::
+ Under ``torch.compile`` with the default inductor backend, torch earlier than 2.15 returns wrong values when a
+ child reads the patches at other positions, a flip for example, after an earlier child has written them
+ (`pytorch/pytorch#198270 <https://github.com/pytorch/pytorch/issues/198270>`__). Eager execution,
+ the ``aot_eager`` backend and torch 2.15 or later are not affected.
+
Examples:
>>> import kornia.augmentation as K
>>> input = torch.randn(2, 3, 224, 224)