Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] For... in / Map... loop #5

Open
rnbwdsh opened this issue Aug 19, 2024 · 0 comments
Open

[Feature request] For... in / Map... loop #5

rnbwdsh opened this issue Aug 19, 2024 · 0 comments

Comments

@rnbwdsh
Copy link

rnbwdsh commented Aug 19, 2024

Would be great if we could have a loop where you pass in a batch and it just iterates over it.

Here is the rough logic that I'd imagine:

  • Batch gets converted to an (internal) accumulation
  • Remaining gets set to the length of this accumulation
  • Output "each" gives 1 item
  • Optional 1: Each gives nr_batch items - so you can rebatch and run N items through a sampler at a time - this way we could even save the "Map End" construct, by emitting a arbitrarily large (nr_batch = 0) batch
  • Optional 2: Map end node starts with 1 acc_add input, if connected it spawns more inputs and outputs (would generally be cool for Loop start/end)
  • Optional 3: If input is an INT, it gets expanded to list(range(int)). In addition to the "remaining" node, a float progress from 0..1 output would be nice - as well as a progress bar on the loop for the sampler
  • Optional 4: CONDITIONINGs are correctly packed/unpacked/appended by this node (or acc generally) - see unpack / pack

Here is an overly complicated workflow on how i archive something like that with 6 nodes (constant number, for loop start, simplemath, accumulate, for loop close, for loop to list)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant