code: def cumprod_to_tensor_axis(self, cumprod):
      
      try:
        return len(self) - 1 - self.cumprod[::-1].index(cumprod)
      except ValueError:
        return None
docs: Maximum tensor axis i such that self.cumprod[i] == cumprod, or None.