def _validate_block_sizes(block_sizes, bijectors, validate_args):
block_sizes_shape = block_sizes.shape<EOL>if tensorshape_util.is_fully_defined(block_sizes_shape):<EOL><INDENT>if (tensorshape_util.rank(block_sizes_shape) != <NUM_LIT:1> or<EOL>(tensorshape_util.num_elements(block_sizes_shape) != len(bijectors))):<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(block_sizes_shape, len(bijectors)))<EOL><DEDENT>return block_sizes<EOL><DEDENT>elif validate_args:<EOL><INDENT>message = ('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>with tf.control_dependencies([<EOL>assert_util.assert_equal(<EOL>tf.size(input=block_sizes), len(bijectors), message=message),<EOL>assert_util.assert_equal(tf.rank(block_sizes), <NUM_LIT:1>)<EOL>]):<EOL><INDENT>return tf.identity(block_sizes)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return block_sizes<EOL><DEDENT>
Helper to validate block sizes.