def is_bool(dtype):
dtype = tf.as_dtype(dtype)<EOL>if hasattr(dtype, '<STR_LIT>'):<EOL><INDENT>return dtype.is_bool<EOL><DEDENT>return np.dtype(dtype).kind == '<STR_LIT:b>'<EOL>
Returns whether this is a boolean data type.