Skip to content

Commit c16e6f9

Browse files
committed
fix normalize dim
1 parent 7338bbe commit c16e6f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

soft_renderer/functional/look_at.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def look_at(vertices, eye, at=[0, 0, 0], up=[0, 1, 0]):
4646
# create new axes
4747
# eps is chosen as 1e-5 to match the chainer version
4848
z_axis = F.normalize(at - eye, eps=1e-5)
49-
x_axis = F.normalize(torch.cross(up, z_axis), eps=1e-5)
50-
y_axis = F.normalize(torch.cross(z_axis, x_axis), eps=1e-5)
49+
x_axis = F.normalize(torch.cross(up, z_axis, dim=1), eps=1e-5)
50+
y_axis = F.normalize(torch.cross(z_axis, x_axis, dim=1), eps=1e-5)
5151

5252
# create rotation matrix: [bs, 3, 3]
5353
r = torch.cat((x_axis[:, None, :], y_axis[:, None, :], z_axis[:, None, :]), dim=1)

0 commit comments

Comments
 (0)