Pass the tensor directly instead of in a tuple.

Otherwise, fails with the error:
ValueError: Please provide model inputs as a list or tuple of 2 or 3 elements: (input, target) or (input, target, sample_weights) Received tf.Tensor(
PiperOrigin-RevId: 277763289
Change-Id: I8fea783d1ce0be53d63c24bde9a6af897d91c7d2
This commit is contained in:
Akshay Modi 2019-10-31 11:20:18 -07:00 committed by TensorFlower Gardener
parent 13038b78f2
commit e54ba169a1

View File

@ -1014,7 +1014,7 @@ class MicroBenchmarks(test.Benchmark):
def _benchmark_keras_model_predict(self, model, run_eagerly=False):
data = random_ops.random_uniform((10, 10), minval=-1, maxval=1)
dataset = dataset_ops.Dataset.from_tensors(tuple([data])).repeat()
dataset = dataset_ops.Dataset.from_tensors([data]).repeat()
model.compile(
gradient_descent.GradientDescentOptimizer(learning_rate=0.001),
loss="mse", run_eagerly=run_eagerly)