Skip to content

Commit 1d092e0

Browse files
committed
Add Jacobian.view function
1 parent 6eba527 commit 1d092e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stochman/nnj.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def __repr__(self):
5151
tensor_repr = tensor_repr.replace("tensor", "jacobian")
5252
tensor_repr += f"\n jactype={self.jactype.value if isinstance(self.jactype, Enum) else self.jactype}"
5353
return tensor_repr
54+
55+
def view(self, *args, **kwargs):
56+
out = super().view(*args, **kwargs)
57+
return jacobian(out, self.jactype)
5458

5559
def __add__(self, other):
5660
if isinstance(other, Jacobian):

0 commit comments

Comments
 (0)