code: def _sparse_coo_flatten_indices(indices: Tensor, shape: tuple):
      # Flatted N-D indices to 1-D indices
      flat_indices = indices.new_zeros(indices.size(1))
      for d, sz in enumerate(shape):
          flat_indices.mul_(sz)
          flat_indices.add_(indices[d])
      return flat_indices
  
imports: import warnings
  from typing import Any, List, Optional, Tuple, TYPE_CHECKING, Union
  import torch
  from torch import Tensor
  from torch.masked import as_masked_tensor, is_masked_tensor, MaskedTensor
  from .None import _docs
  from torch._prims_common import corresponding_real_dtype
  from torch import sym_float
label_desc: Use image node_id 5 for calling a global function with example usage: _sparse_coo_flatten_indices(indices, shape) and returns: flat_indices