code: def build_attn_bias(input_mask, n_head, dtype):
      attn_bias = L.matmul(
          input_mask, input_mask, transpose_y=True
      )  # [batch, seq, seq]
      attn_bias = (1.0 - attn_bias) * -10000.0
      attn_bias = L.stack([attn_bias] * n_head, 1)
      if attn_bias.dtype != dtype:
          attn_bias = L.cast(attn_bias, dtype)
      return attn_bias
  
file_path: PGL/legacy/examples/xformer/transformer_encoder_sparse.py
imports: from functools import partial
  import paddle.fluid
  import paddle.fluid.layers
  import paddle.fluid.layers
  from .sparse_scaled_dot_product_attention import sparse_scaled_dot_product_attention
label_desc: Use image node_id 6 for calling a global function with example usage: build_attn_bias(input_mask, n_head, dtype) and returns: attn_bias