code: def test_add_op():
      """Test add statement to an empty program, also change the output"""
  
      @mb.program(input_specs=[mb.TensorSpec(shape=(2, 4))])
      def prog(x0):
          return x0
  
      print("before:\n{}".format(prog))
      block = prog.functions["main"]
      x0 = block.inputs["x0"]
      with block:
          x1 = mb.log(x=x0)
      block.set_outputs([x1])
      print("after:\n{}".format(prog))
      assert (
          block.inputs["x0"]
          == block.find_ops(op_type="log")[0].inputs["x"]
      )
      assert len(block.operations) == 1
      assert block.operations[0].op_type == "log"
      assert block.outputs[0] == x1
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/tests/test_block.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.testing_utils import get_op_types_in_program, assert_same_output_shapes, assert_same_output_names
  import copy
label_desc: Use image node_id 2 for calling a global function with example usage: test_add_op() and returns: x0