class_docstr: Positional encoding with noise level conditioning
class_docstr_tok: ["Positional","encoding","with","noise","level","conditioning"]
code: def init_pe_matrix(self, n_channels, max_len, x):
      pe = torch.zeros(max_len, n_channels)
      position = torch.arange(0, max_len, dtype=torch.float).unsqueeze(
          1
      )
      div_term = torch.pow(
          10000, torch.arange(0, n_channels, 2).float() / n_channels
      )
  
      pe[:, 0::2] = torch.sin(position / div_term)
      pe[:, 1::2] = torch.cos(position / div_term)
      self.pe = pe.transpose(0, 1).to(x)
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.utils import weight_norm
label_desc: Use image node_id 3 for calling the PositionalEncoding obj's underlying member method code with example usage: obj.init_pe_matrix(n_channels, max_len, x) without return types