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

Autograph fails for keyword-only arguments #28725

Closed
samsamoa opened this issue May 15, 2019 · 3 comments
Closed

Autograph fails for keyword-only arguments #28725

samsamoa opened this issue May 15, 2019 · 3 comments
Assignees
Labels
comp:autograph Autograph related issues TF 2.0 Issues relating to TensorFlow 2.0 type:bug Bug WIP

Comments

@samsamoa
Copy link

samsamoa commented May 15, 2019

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux
  • TensorFlow installed from (source or binary): pip install tf-nightly-gpu-2.0-preview
  • TensorFlow version (use command below): v1.12.1-1847-gc095504 2.0.0-dev20190514
  • Python version: 3.7.3

Describe the current behavior
Autograph complains when compiling functions with keyword-only arguments.

Example output:
W0515 01:46:22.158518 139635868194560 ag_logging.py:145] Entity <function f at 0x7eff8120c1e0> could not be transformed and will be executed as-is. Some features (e.g. tensor-dependent conditionals and loops) may not work as expected. Error details can be found in the logs when running with the env variable AUTOGRAPH_VERBOSITY >= 1. Please report this to the AutoGraph team. Cause: Unexpected error transforming <function f at 0x7eff8120c1e0>. If you believe this is due to a bug, please set the verbosity to 10 (on Linux, export AUTOGRAPH_VERBOSITY=10) and attach the full output when filing the bug report. Caused by: inconsistent nodes: None (NoneType) and None (NoneType)

Describe the expected behavior
Autograph works for keyword-only arguments

Code to reproduce the issue

import tensorflow as tf
@tf.function
def f(*, a):
     return a*2

f(a=0)
@achandraa achandraa self-assigned this May 16, 2019
@achandraa achandraa added TF 2.0 Issues relating to TensorFlow 2.0 comp:autograph Autograph related issues type:bug Bug labels May 16, 2019
@achandraa
Copy link

I have reproduce the mentioned output with TensorFlow version 2.0.0-dev20190515 on Colab.

@jvishnuvardhan jvishnuvardhan added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label May 31, 2019
@mdanatg
Copy link

mdanatg commented May 31, 2019

Thanks for filing the bug! At a glance, it looks related to the lone * arg without a name; probably its name field is None in the AST. We should have fix soon.

@mdanatg mdanatg added the WIP label May 31, 2019
@tensorflowbutler tensorflowbutler removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Jun 1, 2019
@tensorflow-bot
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:autograph Autograph related issues TF 2.0 Issues relating to TensorFlow 2.0 type:bug Bug WIP
Projects
None yet
Development

No branches or pull requests

5 participants