parameters: (tensors, dtype_hierarchy)
return_statement: return [math_ops.cast(t, inferred_dtype) for t in tensors]
docstring: Infers a matching dtype for tensors, and casts them to that dtype.
docstring_summary: Infers a matching dtype for tensors, and casts them to that dtype.
docstring_tokens: Infers a matching dtype for tensors and casts them to that dtype .
function: def _infer_matching_dtype(tensors, dtype_hierarchy):
    """Infers a matching dtype for tensors, and casts them to that dtype."""
    assert all(t.dtype in dtype_hierarchy for t in tensors)
    inferred_dtype = max([t.dtype for t in tensors], key=dtype_hierarchy.index)
    return [math_ops.cast(t, inferred_dtype) for t in tensors]
function_tokens: def _infer_matching_dtype ( tensors , dtype_hierarchy ) : assert all ( t . dtype in dtype_hierarchy for t in tensors ) inferred_dtype = max ( [ t . dtype for t in tensors ] , key = dtype_hierarchy . index ) return [ math_ops . cast ( t , inferred_dtype ) for t in tensors ]