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

(sfnp) add permute host op. #314

Open
monorimet opened this issue Oct 23, 2024 · 0 comments
Open

(sfnp) add permute host op. #314

monorimet opened this issue Oct 23, 2024 · 0 comments

Comments

@monorimet
Copy link
Contributor

monorimet commented Oct 23, 2024

Some use cases require a bit of array handling in between shortfin program invocations or as pre/post-processing steps. In SD workflows, it's common to see a permutation of the image output array in preparation for image library (e.g. pillow)
consumption.

Perhaps implementing the equivalent of np.transpose (docs) would achieve what we need for most cases.

The following is a snippet showing how we use np.transpose in SDXL:

permuted = (
    np.transpose(vae_output, (0, 2, 3, 1))[0]
)
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