code: def _enumerate_directions(x):
      
      backend = get_backend(x)
      shape = backend.shape(x)
      result = []
      for axis_id, axis_length in enumerate(shape):
          shape = [1] * len(shape)
          shape[axis_id] = axis_length
          result.append(backend.reshape(backend.arange(0, axis_length), shape))
      return result
docs: For an n-dimensional tensor, returns tensors to enumerate each axis.
      >>> x = np.zeros([2, 3, 4]) # or any other tensor
      >>> i, j, k = _enumerate_directions(x)
      >>> result = i + 2 * j + 3 * k
  
      result[i, j, k] = i + 2 * j + 3 * k, and also has the same shape as result
      Works very similarly to numpy.ogrid (open indexing grid)