code: def test_valid_if():
      cond = relay.var("cond", dtype="bool", shape=())
      shared = relay.var("shared")
      true_branch = shared
      false_branch = relay.add(shared, shared)
      body = relay.If(cond, true_branch, false_branch)
      shared_bound = relay.var(
          "shared_bound", shape=(1,), dtype="float32"
      )
      body = relay.Let(shared, shared_bound, body)
      """
      The program below uses let binding to control the scope of %shared, which
      follows the basic block normal form.
  
      free_var %shared_bound: Tensor[(1), float32]
      let %shared = %shared_bound;
      free_var %cond: bool
      if (%cond) {
        %shared
      } else {
        add(%shared, %shared)
      }
      """
      check_basic_block_normal_form(body)
  
file_path: tvm/tests/python/relay/test_analysis_basic_block_normal_form.py
imports: import pytest
  import tvm
  from tvm import relay
  from tvm.relay.analysis import check_basic_block_normal_form
label_desc: Use image node_id 4 for calling a global function with example usage: test_valid_if() without return types