code: def stacked_identity(batch_shape, n, dtype):
      shape = batch_shape + (n, n)
      idx = cupy.arange(n)
      x = cupy.zeros(shape, dtype)
      x[..., idx, idx] = 1
      return x
  
file_path: cupy/cupy/linalg/_util.py
imports: import os
  import numpy
  from numpy import linalg
  import cupy
  import cupy._util
  from cupy import _core
  import cupyx
label_desc: Use image node_id 11 for calling a global function with example usage: stacked_identity(batch_shape, n, dtype) and returns: x