Reordering spread

Hello,

In the patch attached I’m trying to dynamically reorder a spread of value (potentially vectors).

Swapdim didn’t work with vectors, they are not ordered correctly, so in this patch select node are creating individual slices for the moment.

Hard to describe more, so I made a spread of indices manually to show what I’m trying to achieve.

Thanks

Reodering spread.v4p (17.9 KB)

I guess patching it differently makes your life easier:

clone.v4p (6.1 KB)

the key to the problem is indeed a lookup table as @readme found out. in this example you can use strings to fake the table lookup (basicall what readme did with the Sift node):

also just for reference since it’s a bit slower because of the VL wrapper, the most correct and flexible way to do it would be to create a lookup dictionary that holds the relation between the key and value:

and then lookup the value for each key and repeat the value as oft as requested:

clone2.zip (7.2 KB)

@tonfilm get some sleep ;)

Well, @readme. Oh, the irony! The nickname is actually a call to read the nickname.
Moreover, the NOT makes @tonfilm’s association a bit awkward.
I’m blaming discourse, though, not sleep deprivation.

lol, corrected. thanks for helping out…

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.