Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScalePyramid gradcheck and docs #189

Merged
merged 1 commit into from Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/geometry.transform.rst
Expand Up @@ -28,3 +28,4 @@ The functions in this section perform various geometrical transformations of 2D
.. autoclass:: Shear
.. autoclass:: PyrDown
.. autoclass:: PyrUp
.. autoclass:: ScalePyramid
11 changes: 11 additions & 0 deletions test/geometry/transform/test_pyramid.py
Expand Up @@ -115,3 +115,14 @@ def test_symmetry_preserving(self):
assert torch.allclose(img, img.flip(1))
assert torch.allclose(img, img.flip(2))
return

def test_gradcheck(self):
batch_size, channels, height, width = 1, 2, 7, 9
img = torch.rand(batch_size, channels, height, width)
img = utils.tensor_to_gradcheck_var(img) # to var
from kornia.geometry import ScalePyramid as SP

def sp_tuple(img):
sp, sigmas, pd = SP()(img)
return tuple(sp)
assert gradcheck(sp_tuple, (img,), raise_exception=True)