Prepare //tensorflow/python/keras:metrics_correctness_test for Tensor equality.

PiperOrigin-RevId: 263671686
(cherry picked from commit c02cc7e858)
This commit is contained in:
Kibeom Kim 2019-08-15 16:55:34 -07:00 committed by Gaurav Jain
parent 5c9a16c77d
commit 5417befa7f

View File

@ -203,7 +203,7 @@ class TensorLikeDataAdapter(DataAdapter):
sample_weights = _process_numpy_inputs(sample_weights)
# If sample_weights are not specified for an output use 1.0 as weights.
if sample_weights is not None and None in sample_weights:
if sample_weights is not None and any(w is None for w in sample_weights):
weight = next(s for s in sample_weights if s is not None)
sample_weights = training_utils.list_to_tuple([
array_ops.ones((weight.shape[0],)) if sw is None else sw