-
Notifications
You must be signed in to change notification settings - Fork 17
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
Module initialization code not reflected in importing script #202
Labels
Comments
khatchad
added a commit
to ponder-lab/ML
that referenced
this issue
Jul 3, 2024
khatchad
added a commit
to ponder-lab/ML
that referenced
this issue
Jul 3, 2024
khatchad
added a commit
to ponder-lab/ML
that referenced
this issue
Jul 8, 2024
khatchad
added a commit
to ponder-lab/Hybridize-Functions-Refactoring
that referenced
this issue
Jul 9, 2024
khatchad
added a commit
to ponder-lab/ML
that referenced
this issue
Jul 9, 2024
khatchad
added a commit
to ponder-lab/ML
that referenced
this issue
Jul 9, 2024
khatchad
added a commit
to ponder-lab/ML
that referenced
this issue
Jul 10, 2024
khatchad
added a commit
to ponder-lab/ML
that referenced
this issue
Jul 10, 2024
khatchad
added a commit
to ponder-lab/ML
that referenced
this issue
Jul 10, 2024
khatchad
added a commit
to ponder-lab/ML
that referenced
this issue
Jul 10, 2024
khatchad
added a commit
to ponder-lab/ML
that referenced
this issue
Jul 21, 2024
There is no such field. Enhancement to the fix for wala#202.
Merged
msridhar
pushed a commit
that referenced
this issue
Nov 8, 2024
Sorry for the large sync up. I'll try to summarize the changes as best as I can: - Start a `CODEOWNERS` file (please modify if desired). - Add dependabot build schedule. - Move Black out of spotless and into the build (much faster; spotless support for Black is not working well). - Various formatting fixes as a result of expanding spotless to XML files and others. - Make other metadata consistent with "recent" change to Java upgrade. - `PYTHONPATH` module fixes (e.g., #209). - Workaround #195. - Enhance TF2 tests: fail if we don't have a node for a function under test (was passing before). Because the ML tests are still on Jython 2 and modules aren't supported there, we have a bunch of tests to consider. - Initialization script enhancements (e.g., #202). - Add `reshape()` parsing (this causes a need for a workaround after exposing a bug). - Some dependency version upgrades. - Various entry point additions, e.g., `abseil`, `click`. - Add missing initialization files (`__init__.py`). --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a module is imported, any code inside
__init__.py
for that module is supposed to be executed. It's supposed to be module initialization code, but really it can be any arbitrary code. In Java, the concept is analogous to a static initializer that is executed when a class is first loaded.The results of the initialization code is supposed to be made available to the importing script. Currently, as a result of #163, we are adding artificial code to load up the subpackages so that they are available to importing scripts. However, we don't do anything about the real code that is there; that code may be importing the subpackages explicitly.
Suppose we have the following code in a script:
Currently, we are expecting that:
nlpgnn/models/__init__.py
is empty.GCNLayer.py
exists innlpgnn/models
.Each of these is false. There is no such file
GCNLayer.py
innlpgnn/models
. Furthermore,nlpgnn/models/__init__.py
is non-empty; in fact, it has the following code:In
nlpgnn/models/GCN.py
we then haveclass GCNLayer
:In the IR for
nlpgnn/models/__init__.py
, we may available the nameGCN
:But, we don't do that for
GCNLayer
. Instead, what happens is that the explicit import drops off the face of the earth:In other words, while
v1
in stored in a global and available to any importing scripts, whilev274
isn't. Consequently, the import code in this file is never reflected in the importer. So, in the IR of oftests/GNN/nodes_graph_classfication/train_gcn.py
:We correctly assign
v268
, butv270
is empty:The text was updated successfully, but these errors were encountered: