Skip to content
Discussion options

You must be logged in to vote

Hi @tomas16 ,

  1. As per the title: is it at all possible to use dr.scatter inside a recorded loop?

Yes, however there are caveats. The first issue is that as you've encountered, you're not allowed to use a placeholder variable as a target. This in particular includes loop state variables and also variables in your body that depend on these state variables

loop = mi.Loop("Iterations", lambda: (active, output, iteration))

while loop(active):
    # If si depends on iteration, active or output then still placeholder
    si = ...

    # Not allowed!
    dr.scatter(si, ...)

So alternatively, you could exclude your scatter target as a loop state variable. However, you cannot attempt to evaluat…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tomas16
Comment options

@wjakob
Comment options

@tomas16
Comment options

Answer selected by tomas16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants