code: def _generate_nd_grid(*sizes):
      coords = [torch.arange(s) for s in sizes]
      return torch.meshgrid(*coords)
  
imports: import math
  from typing import List
  import numpy
  import torch
  from xformers.components.attention.sparsity_config import BigBirdSparsityConfig, BSLongformerSparsityConfig, FixedSparsityConfig, VariableSparsityConfig
label_desc: Use image node_id 1 for calling a global function with example usage: _generate_nd_grid() and returns: torch