8000 fix AffineTransform.sign · pytorch/pytorch@4241158 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4241158

Browse files
fix AffineTransform.sign
1 parent 7d9f26d commit 4241158

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/distributions/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ def __eq__(self, other):
776776
def sign(self) -> int:
777777
if isinstance(self.scale, numbers.Real):
778778
return 1 if float(self.scale) > 0 else -1 if float(self.scale) < 0 else 0
779-
return self.scale.sign()
779+
return int(self.scale.sign().prod().item()) # type: ignore[union-attr]
780780

781781
def _call(self, x):
782782
return self.loc + self.scale * x

0 commit comments

Comments
 (0)
0