class_docstr: The Expectation-Maximization Attention Unit (EMAU).
  
  Arguments:
      c (int): The input and output channel number.
      k (int): The number of the bases.
      stage_num (int): The iteration number for EM.
docstr: Normlize the inp tensor with l2-norm.
  
  Returns a tensor where each sub-tensor of input along the given dim is
  normalized such that the 2-norm of the sub-tensor is equal to 1.
  
  Arguments:
      inp (tensor): The input tensor.
      dim (int): The dimension to slice over to get the ssub-tensors.
  
  Returns:
      (tensor) The normalized tensor.
docstr_tok: ["Normlize","the","inp","tensor","with","l2-norm",".","Returns","a","tensor","where","each","sub-tensor","of","input","along","the","given","dim","is","normalized","such","that","the","2-norm","of","the","sub-tensor","is","equal","to","1",".","Arguments",":","inp","(","tensor",")",":","The","input","tensor",".","dim","(","int",")",":","The","dimension","to","slice","over","to","get","the","ssub-tensors",".","Returns",":","(","tensor",")","The","normalized","tensor","."]
code: def _l2norm(inp, dim):
      """Normlize the inp tensor with l2-norm.
  
      Returns a tensor where each sub-tensor of input along the given dim is
      normalized such that the 2-norm of the sub-tensor is equal to 1.
  
      Arguments:
          inp (tensor): The input tensor.
          dim (int): The dimension to slice over to get the ssub-tensors.
  
      Returns:
          (tensor) The normalized tensor.
      """
      return inp / (1e-6 + inp.norm(dim=dim, keepdim=True))
  
imports: import math
  import torch.utils.model_zoo
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.modules.batchnorm import _BatchNorm
  from .None import settings
label_desc: Use image node_id 3 for calling the EMAU obj's underlying member method code with example usage: obj._l2norm(inp, dim) and returns: unknown