Skip to content

Commit

Permalink
Unit test for face_ddp
Browse files Browse the repository at this point in the history
Summary: Simple test to see if face_dpdt produces the right jacobian for a set of triangles with random sizes.

Differential Revision: D68598423

fbshipit-source-id: b25e198e5f5835c28f1ccb74c15c4370273a8da1
  • Loading branch information
kvenkateshan-meta authored and facebook-github-bot committed Jan 24, 2025
1 parent 910228e commit e2408c6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drtk/utils/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ def face_dpdt(
where: N - batch size; F - number of triangles
"""

if v.ndim != 3:
raise ValueError(f"Expected v to be 3D, got {v.ndim}D")

if vt.ndim != 3:
raise ValueError(f"Expected vt to be 3D, got {vt.ndim}D")

if vt.shape[0] != v.shape[0]:
raise ValueError(
f"Expected vt to have the same batch size as v, got {vt.shape[0]} and {v.shape[0]}"
)

v012 = v[:, vi]
vt012 = vt[:, vti]

Expand Down

0 comments on commit e2408c6

Please sign in to comment.