[Relay][PrettyPrinter] Handling nested Let in Let-binding value


#1
import tvm
import tvm.relay as relay

x = relay.var("data", shape=(1, 16))
x1 = relay.var("x1")
x2 = relay.var("x2")
y = relay.expr.Let(x1, relay.expr.Let(x2, x, relay.add(x2, x2)), relay.multiply(x1, x1))
print(relay.Function(relay.ir_pass.free_vars(y), y))

outputs

fn (%data: Tensor[(1, 16), float32]) {
  let %x1 = let %x2 = %data
  add(%x2, %x2)
  multiply(%x1, %x1)
}

I expect a new scope to be created for the nested let so that the result will be

fn (%data: Tensor[(1, 16), float32]) {
  let %x1 = {
    let %x2 = %data
    add(%x2, %x2)
  }
  multiply(%x1, %x1)
}

cc @joshpoll