class_docstr: An auto-batching DSL context.
  
  Auto-batching DSL operations are methods on the `ProgramBuilder` object.  It's
  used like this:
  
  ```python
  ab = dsl.ProgramBuilder()
  
  def fib_type(arg_types):
    return arg_types[0]
  
  with ab.function(type_inference=fib_type) as fibonacci:
    n = ab.param('n')
    ab.var.cond = ab.primop(lambda n: n > 1)
    with ab.if_(ab.var.cond):
      ab.var.nm1 = ab.primop(lambda n: n - 1)
      ab.var.fibm1 = ab.call(fibonacci, [ab.var.nm1])
      ab.var.nm2 = ab.primop(lambda n: n - 2)
      ab.var.fibm2 = ab.call(fibonacci, [ab.var.nm2])
      ab.var.ans = ab.primop(lambda fibm1, fibm2: fibm1 + fibm2)
    with ab.else_():
      ab.var.ans = ab.const(1)
    ab.return_(ab.var.ans)
  
  prog = ab.program(main=fibonacci)
  # Now `prog` is a well-formed `instructions.Program`, and the context
  # `ab` is no longer needed.
  ```
  
  Note the sequence of method calls on `ProgramBuilder` corresponds to the
  source code of the `Program` being defined, not its runtime behavior.  This is
  because (a) functions are defined with a context manager (rather than a Python
  function) which executes its body immediately and exactly once; and (b)
  function call instructions (and primitive operations) are just recorded, not
  entered recursively.
docstr: Registers a function call instruction.
  
  Example:
  ```
  ab = dsl.ProgramBuilder()
  
  # Define a function
  with ab.function(...) as func:
    ...
    # Call it (recursively)
    ab.var.thing = ab.call(func, ...)
    ...
  ```
  
  Args:
    function: The `instructions.Function` object representing the function to
      call.
    vars_in: Python strings giving the variables to pass in as inputs.
    vars_out: A pattern of Python strings, giving the auto-batched variable(s)
      to which to write the result of the call.  Defaults to the empty list.
  
  Raises:
    ValueError: If the call references undefined auto-batched variables.
  
  Returns:
    op: An `instructions.FunctionCallOp` representing the call.  If one
      subsequently assigns this to a local, via `ProgramBuilder.var.foo = op`,
      that local gets added to the list of output variables.
code: def call(self, function, vars_in, vars_out=None):
      """Registers a function call instruction.
  
      Example:
      ```
      ab = dsl.ProgramBuilder()
  
      # Define a function
      with ab.function(...) as func:
        ...
        # Call it (recursively)
        ab.var.thing = ab.call(func, ...)
        ...
      ```
  
      Args:
        function: The `instructions.Function` object representing the function to
          call.
        vars_in: Python strings giving the variables to pass in as inputs.
        vars_out: A pattern of Python strings, giving the auto-batched variable(s)
          to which to write the result of the call.  Defaults to the empty list.
  
      Raises:
        ValueError: If the call references undefined auto-batched variables.
  
      Returns:
        op: An `instructions.FunctionCallOp` representing the call.  If one
          subsequently assigns this to a local, via `ProgramBuilder.var.foo = op`,
          that local gets added to the list of output variables.
      """
      for var in vars_in:
          if var not in self._var_defs:
              raise ValueError(
                  "Referencing undefined variable {}.".format(var)
              )
      self._prepare_for_instruction()
      if vars_out is None:
          vars_out = []
      call = inst.FunctionCallOp(
          function, _str_list(vars_in), inst.pattern_map(str, vars_out)
      )
      self._blocks[-1].instructions.append(call)
      for var in inst.pattern_traverse(vars_out):
          self._mark_defined(var)
      return call
  
imports: import collections
  import contextlib
  import inspect
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 20 for calling the ProgramBuilder obj's underlying member method code with example usage: obj.call(function, vars_in, vars_out) and returns: call