Skip to content

Commit

Permalink
minor correction.
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-chen committed Aug 8, 2023
1 parent 9540bf7 commit 274fb77
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion pypose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from .lietensor import Sim3_type, sim3_type, RxSO3_type, rxso3_type
from .lietensor import tensor, translation, rotation, scale, matrix, euler
from .lietensor import mat2SO3, mat2SE3, mat2Sim3, mat2RxSO3, from_matrix, matrix, euler2SO3, vec2skew
from .func import *
from .lietensor.lietensor import retain_ltype
from . import func
from .function import *
from .basics import *
from . import module
Expand Down
4 changes: 2 additions & 2 deletions pypose/func/jac.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import torch
from .. import retain_ltype
from typing import Callable, Union, Tuple, Optional
from pypose.lietensor.lietensor import retain_ltype


def jacrev(func: Callable, argnums: Union[int, Tuple[int]] = 0, *, has_aux=False,
Expand Down Expand Up @@ -36,7 +36,7 @@ def jacrev(func: Callable, argnums: Union[int, Tuple[int]] = 0, *, has_aux=False
instead returns a ``(jacobian, aux)`` tuple where ``jacobian``
is the Jacobian and ``aux`` is auxiliary objects returned by ``func``.
A basic usage with our LieTensor type would be the transformation function.
A basic usage with our LieTensor type would be the transformation function.
>>> import pypose as pp
>>> import torch
Expand Down
4 changes: 2 additions & 2 deletions pypose/lietensor/lietensor.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
from torch import nn
from contextlib import contextmanager
from .basics import vec2skew
import collections, numbers, warnings, importlib
from contextlib import contextmanager
from .operation import broadcast_inputs
import collections, numbers, warnings, importlib
from torch.utils._pytree import tree_map, tree_flatten
from .operation import SO3_Log, SE3_Log, RxSO3_Log, Sim3_Log
from .operation import so3_Exp, se3_Exp, rxso3_Exp, sim3_Exp
Expand Down
5 changes: 2 additions & 3 deletions tests/optim/test_jacobian.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
import pypose as pp
from torch import nn
from contextlib import contextmanager
from typing import Collection, Callable
from torch.utils._pytree import tree_map
from torch.autograd.functional import jacobian
from torch.func import functional_call, jacfwd, jacrev
from typing import Collection, Callable

from pypose.lietensor.lietensor import retain_ltype
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")


Expand Down Expand Up @@ -169,7 +168,7 @@ def assert_fn_equal(func1, func2):
}

with check_fn_equal(TO_BE_CHECKED):
with retain_ltype():
with pp.retain_ltype():
jac_func = jacrev(func)
jac = jac_func(pose, points)
assert not pp.hasnan(jac)
Expand Down

0 comments on commit 274fb77

Please sign in to comment.