code: def cal_attention_biases(attention_biases, attention_bias_idxs):
      gather_list = []
      attention_bias_t = paddle.transpose(attention_biases, (1, 0))
      nums = attention_bias_idxs.shape[0]
      for idx in range(nums):
          gather = paddle.gather(
              attention_bias_t, attention_bias_idxs[idx]
          )
          gather_list.append(gather)
      shape0, shape1 = attention_bias_idxs.shape
      gather = paddle.concat(gather_list)
      return paddle.transpose(gather, (1, 0)).reshape(
          (0, shape0, shape1)
      )
  
imports: import itertools
  import math
  import warnings
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import Constant
  from paddle.nn.initializer import TruncatedNormal
  from paddle.regularizer import L2Decay
  from .vision_transformer import Identity
  from .vision_transformer import ones_
  from .vision_transformer import trunc_normal_
  from .vision_transformer import zeros_
label_desc: Use image node_id 1 for calling a global function with example usage: cal_attention_biases(attention_biases, attention_bias_idxs) and returns: paddle