def interpolate_scale(grid, scale):
if len(scale) != <NUM_LIT:2>:<EOL><INDENT>raise NotImplementedError("<STR_LIT>"<EOL>"<STR_LIT>".format(len(scale)))<EOL><DEDENT>deg = tf.compat.dimension_value(<EOL>tensorshape_util.with_rank_at_least(grid.shape, <NUM_LIT:1>)[-<NUM_LIT:1>])<EOL>if deg is None:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>with tf.name_scope("<STR_LIT>"):<EOL><INDENT>return [linop_add_lib.add_operators([<EOL>linop_scale(grid[..., k, q], s)<EOL>for k, s in enumerate(scale)<EOL>])[<NUM_LIT:0>] for q in range(deg)]<EOL><DEDENT>
Helper which interpolates between two scales.