docs: def tril(array, k=0):
      '''Lower triangle of an array.
      Return a copy of an array with elements above the k-th diagonal zeroed.
      Need a multi-dimensional version here because numpy.tril does not
      broadcast for numpy verison < 1.9.'''
      try:
          tril_array = np.tril(array, k=k)
      except:
          # have to loop
          tril_array = np.zeros_like(array)
          shape = array.shape
          otherdims = shape[:-2]
          for index in np.ndindex(otherdims):
              tril_array[index] = np.tril(array[index], k=k)
      return tril_array