def get_tile_dims(tile_dims, imshape):
if tile_dims is None:<EOL><INDENT>td = None<EOL><DEDENT>else:<EOL><INDENT>td = numpy.array(tile_dims, dtype='<STR_LIT>')<EOL>nd = len(imshape)<EOL>if td.size != nd:<EOL><INDENT>msg = "<STR_LIT>" % (td.size, nd)<EOL>raise ValueError(msg)<EOL><DEDENT><DEDENT>return td<EOL>
Just make sure the tile dims has the appropriate number of dimensions