code: def forward_masks(self, x):
      x = self.initial_bn(x)
      bs = x.shape[0]  # batch size
      prior = torch.ones((bs, self.attention_dim)).to(x.device)
      M_explain = torch.zeros(x.shape).to(x.device)
      att = self.initial_splitter(x)[:, self.n_d :]
      masks = {}
  
      for step in range(self.n_steps):
          M = self.att_transformers[step](prior, att)
          M_feature_level = torch.matmul(M, self.group_attention_matrix)
          masks[step] = M_feature_level
          # update prior
          prior = torch.mul(self.gamma - M, prior)
          # output
          masked_x = torch.mul(M_feature_level, x)
          out = self.feat_transformers[step](masked_x)
          d = ReLU()(out[:, : self.n_d])
          # explain
          step_importance = torch.sum(d, dim=1)
          M_explain += torch.mul(
              M_feature_level, step_importance.unsqueeze(dim=1)
          )
          # update attention
          att = out[:, self.n_d :]
  
      return M_explain, masks
  
imports: import torch
  from torch.nn import Linear, BatchNorm1d, ReLU
  import numpy
  from pytorch_tabnet import sparsemax
label_desc: Use image node_id 3 for calling the TabNetEncoder obj's underlying member method code with example usage: obj.forward_masks(x) and returns: M_explain,  masks