code: def num_discarded(self):
      
      if not self._data:
        return 0
      n = 0
      while n < len(self._data):
        if not isinstance(self._data[n], _TensorValueDiscarded):
          break
        n += 1
      return n
docs: Get the number of values discarded due to exceeding both limits.