Commit 72bbefcf authored by Akshay Agrawal's avatar Akshay Agrawal Committed by TensorFlower Gardener
Browse files

Fail if a noninitial defun trace of a Python function creates tf.Variables.

Only the first trace of a Python function via defun is permitted to create
tf.Variables. Creating Variables on subsequent traces typically indicates
user error and can lead to surprising behavior.

Additionally, :%s/compile/trace/g to emphasize that defun is not a compiler (i.e., it does not in general preserve the semantics of the original Python function).

PiperOrigin-RevId: 212036521
parent 9f7e6bad
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment