code: def squash(x: torch.Tensor):
      x_norm = x.norm(p=2, dim=-1, keepdim=True)
      mag = x_norm**2
      out = x / x_norm * mag / (1 + mag)
  
      return out
  
file_path: DeepKE/src/deepke/attribution_extraction/standard/module/Capsule.py
imports: import logging
  import torch
  import torch.nn
label_desc: Use image node_id 3 for calling the Capsule obj's underlying member method code with example usage: obj.squash(x) and returns: out