Any way to extract tir function from relay?

@Wheest for exmaple, build the relay, and the relay trans to relay ir.

first to get lib.

    with tvm.transform.PassContext(opt_level=3):
        lib =, target=target, params=params_bert)

the ir contains below layer structure,

%22 = reshape(%21, newshape=[-1, 1024]) /* ty=Tensor[(256, 1024), float32] */;
%23 = cast(%bert.encoder.layer.attention.self.query.weight, dtype="float16") /* ty=Tensor[(1024, 1024), float16] */;

the tir func may like below

@tvmgen_default_fused_reshape_cast = primfn(args_7: handle, arg_type_ids_7: handle, num_args_7: int32, out_ret_value_7: handle, out_ret_tcode_7: handle, resource_handle_7: handle) -> int32

how can i get the tir func and feed other input, only test this kernel for some reason?