code: def masked_select(input, mask):
      """masked_select
  
      Slice the value from given Mask
  
      Args:
          input: Input tensor to be selected
  
          mask: A bool tensor for sliced.
  
      Return:
          Part of inputs where mask is True.
      """
      index = L.where(mask)
      return L.gather(input, index, overwrite=False)
  
file_path: PGL/legacy/examples/xformer/sparse_scaled_dot_product_attention.py
imports: import paddle.fluid
  import paddle.fluid.layers
  import paddle.fluid.layers
  from pgl.utils import paddle_helper
  import pgl
label_desc: Use image node_id 1 for calling a global function with example usage: masked_select(input, mask) and returns: L