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

Type inference using type annotations #41256

Closed
wants to merge 5 commits into from

Conversation

rahul-kamat
Copy link
Contributor

Performs type inference using type annotations.
A dictionary with variable names mapped to a list of possible types is added to the AST nodes.

Example

def f(x: tf.Tensor, a: int):
  if y > 0:
    y = x + y
  return y

The AST will be annotated with:
y = x + y:

___pyct_anno={SCOPE: Scope{r=(x, y,), w=(y,)}, 'type_anno_read': {x: {tf.Tensor}, y: {int}}, 'type_anno_write': {y: {tf.Tensor}}}

return y:

___pyct_anno={SCOPE: Scope{r=(y,), w=()}, 'type_anno_read': {y: {tf.Tensor, int}}, 'type_anno_write': {}}

Note: This is experimental and does not infer types for variables assigned to a python object.

@google-ml-butler google-ml-butler bot added the size:L CL Change Size: Large label Jul 10, 2020
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Jul 10, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jul 10, 2020
@rthadur
Copy link
Contributor

rthadur commented Nov 2, 2020

@rahul-kamat can you please check ubuntu sanity build failures ?

@rthadur rthadur removed the ready to pull PR ready for merge process label Nov 2, 2020
@rthadur rthadur added this to Assigned Reviewer in PR Queue via automation Nov 2, 2020
@gbaned gbaned added the stat:awaiting response Status - Awaiting response from author label Nov 11, 2020
@tensorflowbutler tensorflowbutler added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Nov 28, 2020
@mdanatg
Copy link

mdanatg commented Nov 30, 2020

The PR is still valid, but we've been delayed on the integration.

@rthadur rthadur removed stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author labels Nov 30, 2020
@gbaned gbaned added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Dec 3, 2020
@kkimdev kkimdev removed their request for review December 13, 2020 11:39
@gbaned gbaned removed their assignment Oct 28, 2021
@gbaned
Copy link
Contributor

gbaned commented Apr 26, 2024

Hi @rahul-kamat, @mdanatg I'm going to go ahead and close this PR, because it seems to have stalled. If you're still interested in pursing this (and responding to my comments), please feel free to reopen! Thank you for your contribution!

@gbaned gbaned closed this Apr 26, 2024
PR Queue automation moved this from Assigned Reviewer to Closed/Rejected Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes size:L CL Change Size: Large stat:awaiting tensorflower Status - Awaiting response from tensorflower
Projects
PR Queue
  
Closed/Rejected
Development

Successfully merging this pull request may close these issues.

None yet

7 participants