Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Adds the minimum viable code introspection tooling to Runtime - given a compiled Function, this will check the associated converter for functions with matching names and generate the string representations thereof. Will throw a ValueError if nothing is found (most likely because the relevant Function hasn't been run/compiled yet).
Approach
The ideal approach would add a method to the jit-compiled code (see numba's inspect_types), however this can't be done with the existing Entrypoint decorator as Functions don't implement the dict method, so setattr() doesn't work. A C++ method on the Functions would generate overhead for little gain. One workaround would be to implement a wrapper and masquerade such that the interpreter got access to a wrapped version of the Function with the associated utility methods, with the compiler ignoring this wrapper (credit to @guslonergan).
Further work - some equivalent of https://python-ast-explorer.com/ for the two ASTs, perhaps using ODB.
How Has This Been Tested?
Ran test script on a basic sum function with and without compilation, and checked the output.
Types of changes
Checklist: