Skip to content

fix: use torch padding for kornia 0.8 compatibility - #508

Open
Nianze Wu (wunianze666-netizen) wants to merge 1 commit into
Lightricks:masterfrom
wunianze666-netizen:fix/kornia-pad-compatibility
Open

fix: use torch padding for kornia 0.8 compatibility#508
Nianze Wu (wunianze666-netizen) wants to merge 1 commit into
Lightricks:masterfrom
wunianze666-netizen:fix/kornia-pad-compatibility

Conversation

@wunianze666-netizen

@wunianze666-netizen Nianze Wu (wunianze666-netizen) commented Jun 9, 2026

Copy link
Copy Markdown

Summary

  • stop importing pad from Kornia's pyramid module
  • use torch.nn.functional.pad() for the existing reflect-padding paths

Problem

Kornia 0.8.3 no longer exports pad from kornia.geometry.transform.pyramid, so the current import prevents the node module from loading. PyTorch's functional pad provides the same padding operation already used here and avoids relying on Kornia's former internal re-export.

Validation

  • inspected the official kornia-0.8.3-py3-none-any.whl: pyramid.py has no exported pad function and its __all__ excludes pad
  • rechecked current upstream master (ac4d998); it still imports the removed symbol
  • py -m py_compile pyramid_blending.py
  • git diff --check

@wunianze666-netizen

Copy link
Copy Markdown
Author

Revalidated this against current master (ac4d998) and the official Kornia 0.8.3 wheel: pyramid.py no longer exports pad, while the repository still imports it. This PR remains a focused two-call replacement using the already imported torch.nn.functional module. A maintainer review would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant