Commit 556e5ca3 authored by Asim Shankar's avatar Asim Shankar Committed by TensorFlower Gardener
Browse files

gradient_checker: Convert arguments to tensors.

Without this change, the test added to gradient_checker_v2_test.py
would fail with an error like:

AttributeError: 'numpy.ndarray' object has no attribute '_id'

in the call to "tape.watch(x)".

Since gradient_checker_v2.compute_gradients() requires that the "x" argument be
a list of Tensors, it seems reasonable to ensure that the "f" argument is
provided with Tensors.

While at it, also check that the "x" argument is a list to provide a clearer
error message than would be obtained without this check.

PiperOrigin-RevId: 223820537
parent 2dcceda2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment