def _get_max_identity(tf_dtype):
    numpy_tf_dtype = tf_dtype.as_numpy_dtype
    if ((tf_dtype == tf.bfloat16) or dtypes.issubdtype(numpy_tf_dtype, np.inexact)):
        return numpy_tf_dtype((- np.inf))
    elif dtypes.issubdtype(numpy_tf_dtype, np.integer):
        return dtypes.iinfo(numpy_tf_dtype).min
    else:
        assert dtypes.issubdtype(numpy_tf_dtype, np.bool_), f'{tf_dtype} has no defined max identity'
        return False
def _get_max_identity(tf_dtype):
    numpy_tf_dtype = tf_dtype.as_numpy_dtype
    if ((tf_dtype == tf.bfloat16) or dtypes.issubdtype(numpy_tf_dtype, np.inexact)):
        return numpy_tf_dtype((- np.inf))
    elif dtypes.issubdtype(numpy_tf_dtype, np.integer):
        return dtypes.iinfo(numpy_tf_dtype).min
    else:
        assert dtypes.issubdtype(numpy_tf_dtype, np.bool_), f'{tf_dtype} has no defined max identity'
        return False