original_docstring: Helper which interpolates between two scales.
docstring: Helper which interpolates between two scales.
docstring_tokens: Helper which interpolates between two scales .
code: def interpolate_scale(grid, scale):
    """Helper which interpolates between two scales."""
    if len(scale) != 2:
      raise NotImplementedError("Currently only bimixtures are supported; "
                                "len(scale)={} is not 2.".format(len(scale)))
    deg = grid.shape.with_rank_at_least(1)[-1].value
    if deg is None:
      raise ValueError("Num quadrature grid points must be known prior "
                       "to graph execution.")
    with ops.name_scope("interpolate_scale", values=[grid]):
      return [linop_add_lib.add_operators([
          linop_scale(grid[..., k, q], s)
          for k, s in enumerate(scale)
      ])[0] for q in range(deg)]
code_tokens: def interpolate_scale ( grid , scale ) : if len ( scale ) != 2 : raise NotImplementedError ( "Currently only bimixtures are supported; " "len(scale)={} is not 2." . format ( len ( scale ) ) ) deg = grid . shape . with_rank_at_least ( 1 ) [ - 1 ] . value if deg is None : raise ValueError ( "Num quadrature grid points must be known prior " "to graph execution." ) with ops . name_scope ( "interpolate_scale" , values = [ grid ] ) : return [ linop_add_lib . add_operators ( [ linop_scale ( grid [ ... , k , q ] , s ) for k , s in enumerate ( scale ) ] ) [ 0 ] for q in range ( deg ) ]
short_docstring: Helper which interpolates between two scales.
short_docstring_tokens: Helper which interpolates between two scales .
comment: """Helper which interpolates between two scales."""