code: def batch_matmul(
      lhs, rhs, transa=False, transb=False, iterative=False, **kwargs
  ):
      """Create an extern op that compute batched matrix mult of A and rhs with CBLAS
      This function serves as an example on how to call external libraries.
  
      Parameters
      ----------
      lhs: Tensor
          The left matrix operand
      rhs: Tensor
          The right matrix operand
      transa: bool
          Whether transpose lhs
      transb: bool
          Whether transpose rhs
  
      Returns
      -------
      C: Tensor
          The result tensor.
      """
      b = te.max(lhs.shape[0], rhs.shape[0])
      n = lhs.shape[2] if transa else lhs.shape[1]
      m = rhs.shape[1] if transb else rhs.shape[2]
      return te.extern(
          (b, n, m),
          [lhs, rhs],
          lambda ins, outs: tvm.tir.call_packed(
              "tvm.contrib.cblas.batch_matmul"
              if not iterative
              else "tvm.contrib.cblas.batch_matmul_iterative",
              ins[0],
              ins[1],
              outs[0],
              transa,
              transb,
          ),
          name="C",
          **kwargs,
      )
  
imports: import tvm
  from tvm import te
label_desc: Use image node_id 2 for calling a global function with example usage: batch_matmul(lhs, rhs, transa, transb, iterative) and returns: te