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
Loading
Please sign in to comment