Nested Pytree Indexing #9884
Unanswered
joeryjoery
asked this question in
Q&A
Replies: 1 comment 4 replies
-
What do you mean by "extract"? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Say I have a Pytree
a
, which is an outer product ofb
withb
.How could I efficiently extract elements from
a
given the pytree definition ofb
?Because the structure of
a
is defined by the structure ofb
for every element inb
.An example use-case is to extract the diagonal of the Hessian contained in an awkard nested pytree without flattening.
Beta Was this translation helpful? Give feedback.
All reactions