def _maybe_validate_matrix(a, validate_args):
assertions = []<EOL>if not a.dtype.is_floating:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(a.dtype.name))<EOL><DEDENT>if a.shape.ndims is not None:<EOL><INDENT>if a.shape.ndims < <NUM_LIT:2>:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>'.format(a.shape.ndims))<EOL><DEDENT><DEDENT>elif validate_args:<EOL><INDENT>assertions.append(tf.compat.v1.assert_rank_at_least(<EOL>a, rank=<NUM_LIT:2>, message='<STR_LIT>'))<EOL><DEDENT>return assertions<EOL>
Checks that input is a `float` matrix.