code: def test_launch_layer_norm_i8O():
      batch_size, seq_len = kt.bs_sl()
      bsz_seq = batch_size * seq_len
      hidden_dim = kt.hidden_dim
      with_mean = random.choice([True, False])
      print(
          "(batch_token_num, hidden_dim, with_mean): "
          f"({bsz_seq}, {hidden_dim}, {with_mean})"
      )
  
      # shared weights
      inp = kt.rand((bsz_seq, hidden_dim))
      gamma = kt.rand((hidden_dim))
      beta = kt.rand((hidden_dim))
      vars = kt.rand((bsz_seq))
      means = kt.rand((bsz_seq))
      cmax = kt.topk(inp)
  
      # custom weights
      custom_res = kt.randint8((bsz_seq, hidden_dim))
      custom_cmask = kt.randuint8((bsz_seq, hidden_dim))
  
      if kt.dtype == torch.float:
          func = cuda_module.torch_launch_layer_norm_i8_fp32
      else:
          func = cuda_module.torch_launch_layer_norm_i8_fp16
  
      def custom():
          custom_cmask.zero_()
          test_res = inp.clone()
          func(
              custom_res,
              custom_cmask,
              vars,
              means,
              inp,
              gamma,
              beta,
              cmax,
              bsz_seq,
              hidden_dim,
              with_mean,
          )
  
          return (
              [custom_res, vars, means, custom_cmask]
              if with_mean
              else [custom_res, vars, custom_cmask]
          )
  
      def baseline():
          base_res = torch.nn.functional.layer_norm(
              inp, [hidden_dim], gamma, beta, kt.epsilon
          )
          base_res, base_cmask = kt.quantize(base_res, cmax)
  
          if with_mean:
              return [
                  base_res.contiguous(),
                  inp.var(dim=1).contiguous(),
                  inp.mean(dim=1).contiguous(),
                  base_cmask.contiguous(),
              ]
          else:
              return [
                  base_res.contiguous(),
                  inp.var(dim=1).contiguous(),
                  base_cmask.contiguous(),
              ]
  
      return custom, baseline
  
imports: import random
  import torch
  from torch._C import ScriptModule, dtype
  from torch.nn import functional
  from lightseq.training.ops.pytorch.builder import KernelBuilder, AdamBuilder
  from tests.util import TestDecorator
  from torch_crf import CRF
label_desc: Use image node_id 11 for calling a global function with example usage: test_launch_layer_norm_i8O() and returns: custom,  baseline, unknown, list, list