code: def _build_position_ids(self, src_ids):
      src_shape = L.shape(src_ids)
      src_seqlen = src_shape[1]
      src_batch = src_shape[0]
  
      slot_seqlen = self.slot_seqlen
  
      num_b = (src_seqlen / slot_seqlen) - 1
      a_position_ids = L.reshape(
          L.range(0, slot_seqlen, 1, dtype="int32"),
          [1, slot_seqlen],
          inplace=True,
      )  # [1, slot_seqlen]
      a_position_ids = L.expand(
          a_position_ids, [src_batch, 1]
      )  # [B, slot_seqlen]
  
      input_mask = L.cast(
          src_ids[:, :slot_seqlen] == 0, "int32"
      )  # assume pad id == 0 [B, slot_seqlen, 1]
      a_pad_len = L.reduce_sum(input_mask, 1)  # [B, 1]
  
      b_position_ids = L.reshape(
          L.range(slot_seqlen, 2 * slot_seqlen, 1, dtype="int32"),
          [1, slot_seqlen],
          inplace=True,
      )  # [1, slot_seqlen]
      b_position_ids = L.expand(
          b_position_ids, [src_batch, num_b]
      )  # [B, slot_seqlen * num_b]
      b_position_ids = (
          b_position_ids - a_pad_len
      )  # [B, slot_seqlen * num_b]
  
      position_ids = L.concat([a_position_ids, b_position_ids], 1)
      position_ids = L.cast(position_ids, "int64")
      position_ids.stop_gradient = True
      return position_ids
  
imports: import os
  import json
  import numpy
  import pgl
  import paddle.fluid
  import paddle.fluid.layers
  from ernie import ErnieModel
  from pgl.utils.logger import log
label_desc: Use image node_id 4 for calling the ERNIESageV3Encoder obj's underlying member method code with example usage: obj._build_position_ids(src_ids) and returns: position_ids