code: def __init__(self, cfg):
      super(Capsule, self).__init__()
  
      # self.xxx = cfg.xxx
      self.input_dim_capsule = cfg.input_dim_capsule
      self.dim_capsule = cfg.dim_capsule
      self.num_capsule = cfg.num_capsule
      self.batch_size = cfg.batch_size
      self.share_weights = cfg.share_weights
      self.num_iterations = cfg.num_iterations
  
      if self.share_weights:
          W = torch.zeros(
              1,
              self.input_dim_capsule,
              self.num_capsule * self.dim_capsule,
          )
      else:
          W = torch.zeros(
              self.batch_size,
              self.input_dim_capsule,
              self.num_capsule * self.dim_capsule,
          )
  
      W = nn.init.xavier_normal_(W)
      self.W = nn.Parameter(W)
  
file_path: DeepKE/src/deepke/relation_extraction/standard/module/Capsule.py
imports: import logging
  import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new Capsule object from inherited base classes: nn with example: obj = Capsule(cfg)