code: def index_to_mask(index: torch.Tensor, size):
      mask = torch.zeros(size, dtype=torch.bool, device=index.device)
      mask[index] = True
      return mask
  
file_path: AutoGL/autogl/datasets/utils/_general.py
imports: import numpy
  import random
  import torch
  import torch.utils.data
  import typing
  from sklearn.model_selection import StratifiedKFold, KFold
  from autogl import backend
  from autogl.data import InMemoryDataset
label_desc: Use image node_id 1 for calling a global function with example usage: index_to_mask(index, size) and returns: mask