catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

Remove redundant flatten/unflatten of PyTrees

Open rauletorresc opened this issue 6 months ago • 3 comments

Context: When calling get_abstract_signature from within get_decomposed_signature we are flattening/unflattening the PyTree one more time without need. In this sense get_abstract_signature is just a wrapper for the shaped_abstractify function that we don't need here.

Description of the Change: Avoid the wrapper function call and use shaped_abstractify directly.

Benefits: Avoid code that does nothing.

rauletorresc avatar Apr 14 '25 23:04 rauletorresc