SIGN IN SIGN UP

Add MethodMeta object for python visibility (#5571)

Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/5571

Some clients and consumers of the Executorch program files (.pte) were
requesting ways to access metadata like the sizes of tensors and the number
of bytes they needed.
When I told them how to access them in C++, they requested Python wrappers
since they had processing scripts written in Python.

Add some implementations of MethodMeta and TensorInfo methods.
Note that these become more expensive than in C++ because they need to
allocate python objects, but I doubt these are used in
performance-sensitive applications anyway. And dealing with
lifetimes of mixed C++/Python objects is complex, so I favored simple lifetimes.

Reviewed By: dbort

Differential Revision: D63288433

fbshipit-source-id: af775120a8ebd9bf455671a8ce1f158259aa50e6
R
Riley Dulin committed
4dcee852eb682be2e5d4acea2f3eacbf0bbc3f79
Parent: 3bedd8b
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 9/26/2024, 5:38:22 PM