code: def __init__(
      self,
      num_heads,
      num_segments=1,
      num_buckets=32,
      max_distance=128,
      bidirectional=False,
      dtype=torch.half,
      init_mean: float = 0.0,
      init_std: float = 1,
  ):
      super().__init__()
  
      self.num_heads = num_heads
      self.num_buckets = num_buckets
      self.max_distance = max_distance
      self.bidirectional = bidirectional
      self.num_segments = num_segments
  
      self.relative_attention_bias = torch.nn.parameter.Parameter(
          torch.empty(
              num_segments * num_segments + num_buckets,
              num_heads,
              dtype=dtype,
          )
      )
  
file_path: DeepKE/example/llm/CPM-Bee/src/cpm_live/native_layers/position_embedding.py
imports: import math
  from typing import Union
  import torch
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new SegmentPositionEmbedding object from inherited base classes: torch.nn with example: obj = SegmentPositionEmbedding(num_heads, num_segments, num_buckets, max_distance, bidirectional, dtype, init_mean, init_std)