class_docstr: A linear layer with Xavier initialization
  
  Arguments
  ---------
  in_dim: int
      the input dimension
  out_dim: int
      the output dimension
  bias: bool
      whether or not to use a bias
  w_init_gain: linear
      the weight initialization gain type (see torch.nn.init.calculate_gain)
  
  Example
  -------
  >>> import torch
  >>> from speechbrain.lobes.models.Tacotron2 import LinearNorm
  >>> layer = LinearNorm(in_dim=5, out_dim=3)
  >>> x = torch.randn(3, 5)
  >>> y = layer(x)
  >>> y.shape
  torch.Size([3, 3])
class_docstr_tok: ["A","linear","layer","with","Xavier","initialization","Arguments","--","--","--","--","-","in_dim",":","int","the","input","dimension","out_dim",":","int","the","output","dimension","bias",":","bool","whether","or","not","to","use","a","bias","w_init_gain",":","linear","the","weight","initialization","gain","type","(","see","torch.nn.init.calculate_gain",")","Example","--","--","--","-",">",">",">","import","torch",">",">",">","from","speechbrain.lobes.models.Tacotron2","import","LinearNorm",">",">",">","layer","=","LinearNorm","(","in_dim=5",",","out_dim=3",")",">",">",">","x","=","torch.randn","(","3",",","5",")",">",">",">","y","=","layer","(","x",")",">",">",">","y.shape","torch.Size","(","[","3",",","3","]",")"]
code: def __init__(self, in_dim, out_dim, bias=True, w_init_gain="linear"):
      super().__init__()
      self.linear_layer = torch.nn.Linear(in_dim, out_dim, bias=bias)
  
      torch.nn.init.xavier_uniform_(
          self.linear_layer.weight,
          gain=torch.nn.init.calculate_gain(w_init_gain),
      )
  
imports: from math import sqrt
  from speechbrain.nnet.loss.guidedattn_loss import GuidedAttentionLoss
  from speechbrain.lobes.models.transformer.Transformer import get_mask_from_lengths
  import torch
  from torch import nn
  from torch.nn import functional
  from collections import namedtuple
label_desc: Use image node_id 1 to create a new LinearNorm object from inherited base classes: torch.nn with example: obj = LinearNorm(in_dim, out_dim, bias, w_init_gain)