code: def _compute_ndim(row_loc, col_loc):
      
      row_scaler = is_scalar(row_loc)
      col_scaler = is_scalar(col_loc)
  
      if row_scaler and col_scaler:
          ndim = 0
      elif row_scaler ^ col_scaler:
          ndim = 1
      else:
          ndim = 2
  
      return ndim
docs: Compute the ndim of result from locators