Skip to content
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

Using XML summaries to add TF2 APIs #33

Merged
merged 31 commits into from
Jun 26, 2023
Merged

Using XML summaries to add TF2 APIs #33

merged 31 commits into from
Jun 26, 2023

Conversation

tatianacv
Copy link
Member

@tatianacv tatianacv commented Jun 22, 2023

Changing tensorflow.xml to accept TensorFlow 2 APIs (https://github.com/ponder-lab/Hybridize-Functions-Refactoring/wiki/TF2-tensor-generators). In this PR, we have the level 1 APIs and the level 2 API random.uniform. This PR addresses the following issues:

  1. IllegalStateException when using from...import wala/ML#60
  2. Can't determine whether an API call is from TensorFlow when more than two functions are in a call chain wala/ML#49

In this PR, we make sure that we use different importing schemes, such as:

  • from tensorflow import [TF API]
  • import tensorflow
  • from tensorflow as [alias]
  • using FQNs instead of tensorflow

The only importing scheme we currently don't support in this code is from tensorflow import * (https://github.com/ponder-lab/ML/issues/34)

khatchad and others added 10 commits June 22, 2023 13:23
java.lang.AssertionError: expected:<2> but was:<3>
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.failNotEquals(Assert.java:835)
	at org.junit.Assert.assertEquals(Assert.java:647)
	at org.junit.Assert.assertEquals(Assert.java:633)
	at com.ibm.wala.cast.python.ml.test.TestTensorflowModel.testTf2(TestTensorflowModel.java:153)
	at com.ibm.wala.cast.python.ml.test.TestTensorflowModel.testTf2(TestTensorflowModel.java:70)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Copy link
Member

@khatchad khatchad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add a test case from tensorflow impot ones?

@tatianacv
Copy link
Member Author

Can we also add a test case from tensorflow impot ones?

Added in f723316

@khatchad
Copy link
Member

Can we also add a test case from tensorflow impot ones?

Added in f723316

Did we have this test previously?

@ponder-lab ponder-lab deleted a comment from tatianacv Jun 23, 2023
@tatianacv
Copy link
Member Author

Can we also add a test case from tensorflow impot ones?

Added in f723316

Did we have this test previously?

We didn't.

@tatianacv tatianacv marked this pull request as ready for review June 23, 2023 18:04
@tatianacv tatianacv changed the title Summaries playground Using XML summaries to add TF2 APIs Jun 26, 2023
@ponder-lab ponder-lab deleted a comment from tatianacv Jun 26, 2023
@ponder-lab ponder-lab deleted a comment from tatianacv Jun 26, 2023
@khatchad khatchad merged commit 3597d2b into master Jun 26, 2023
@khatchad khatchad deleted the summaries_playground branch June 26, 2023 19:21
tatianacv added a commit that referenced this pull request Jun 26, 2023
All "level 1" APIs and one "level 2" API is now inferred via summaries.

---------

Co-authored-by: Raffi Khatchadourian <raffi.khatchadourian@hunter.cuny.edu>
khatchad added a commit that referenced this pull request Jun 27, 2023
Now fixed by #33.

---------

Co-authored-by: Raffi Khatchadourian <raffi.khatchadourian@hunter.cuny.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants