Skip to content

Commit

Permalink
Minor improvements to dr.shuffle()
Browse files Browse the repository at this point in the history
  • Loading branch information
Speierers committed Sep 20, 2022
1 parent e75f4cf commit 1230f10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drjit/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -3177,7 +3177,8 @@ def sh_eval(arg, order, /):

def shuffle(perm, value):
'''
Permute the entries of the provided Dr.Jit array for the indices given in ``perm``.
Permute the entries of the provided Dr.Jit static array for the indices
given in ``perm``.
The pseudocode for this operation is
Expand All @@ -3187,12 +3188,12 @@ def shuffle(perm, value):
Args:
perm (drjit.ArrayBase): A Python list of integers
value (drjit.ArrayBase): A Dr.Jit array type
value (drjit.ArrayBase): A Dr.Jit static array type
Returns:
Shuffled input array
'''
if not _dr.is_array_v(value) or len(perm) != value.Size:
if not _dr.is_static_array_v(value) or len(perm) != value.Size:
raise Exception("shuffle(): incompatible input!")

result = type(value)()
Expand Down

0 comments on commit 1230f10

Please sign in to comment.