Commit 2ff8c85d authored by Asim Shankar's avatar Asim Shankar Committed by TensorFlower Gardener
Browse files

[eager]: Correctly handle operation arguments of mixed types in the slow path.

Consider the following:

import tensorflow as tf
tf.enable_eager_execution()
x = tf.Variable(1.0)
tf.Print(x, ["foo", x])

Prior to this commit, this snippet would fail with an error:

ValueError: exceptions.TypeError: object of type 'ResourceVariable' has no len()

raised from the call to ops.EagerTensor in convert_to_mixed_eager_tensors.

With this commit, the tf.Print call works correctly.
Note that convert_to_mixed_eager_tensors is only called in the slow path of operation execution (i.e., when TFE_Py_FastPathExecute fails). Which happens rarely (e.g., when mixing primitive string and EagerTensor/ResourceVariable arguments).

PiperOrigin-RevId: 205408407
parent 8d14663d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment