code: def l2norm(
      self, sizea, sizeb, applier, repeat_tensors, in_type, per_tensor
  ):
      self.overflow_buf.zero_()
      a = torch.cuda.FloatTensor(sizea).fill_(self.val)
      b = torch.cuda.FloatTensor(sizeb).fill_(self.val)
  
      in_list = []
      for i in range(repeat_tensors):
          in_list += [a.clone().to(in_type), b.clone().to(in_type)]
  
      if per_tensor:
          norm, norm_per_tensor = applier(
              multi_tensor_l2norm, self.overflow_buf, [in_list], True
          )
          normab = torch.cat((a.norm().view(1), b.norm().view(1)))
          norm_per_tensor = norm_per_tensor.view(-1, 2)
      else:
          norm, _ = applier(
              multi_tensor_l2norm, self.overflow_buf, [in_list], True
          )
  
      reference = (
          torch.cuda.FloatTensor((sizea + sizeb) * repeat_tensors)
          .fill_(self.val)
          .norm()
      )
  
      torch.testing.assert_close(
          norm, reference.broadcast_to(norm.shape)
      )
      if per_tensor:
          torch.testing.assert_close(
              norm_per_tensor,
              normab.broadcast_to(norm_per_tensor.shape),
          )
      self.assertTrue(self.overflow_buf.item() == 0)
  
file_path: apex/tests/L0/run_amp/test_multi_tensor_l2norm.py
imports: import unittest
  import functools
  import itertools
  from apex import amp
  import torch
  from torch import nn
  import torch.nn.functional
  from utils import common_init, HALF, FLOAT, ALWAYS_HALF, ALWAYS_FLOAT, MATCH_INPUT
label_desc: Use image node_id 3 for calling the TestMultiTensorL2Norm obj's underlying member method code with example usage: obj.l2norm(sizea, sizeb, applier, repeat_tensors, in_type, per_tensor) without return types