Returns a nested Python `list` with the values for this `RaggedTensor`. Requires that `rt` was constructed in eager execution mode. Returns: A nested Python `list`.
(self)
| 1792 | #============================================================================= |
| 1793 | |
| 1794 | def to_list(self): |
| 1795 | """Returns a nested Python `list` with the values for this `RaggedTensor`. |
| 1796 | |
| 1797 | Requires that `rt` was constructed in eager execution mode. |
| 1798 | |
| 1799 | Returns: |
| 1800 | A nested Python `list`. |
| 1801 | """ |
| 1802 | if self._is_eager(): |
| 1803 | return self._eager_value().to_list() |
| 1804 | else: |
| 1805 | raise ValueError("RaggedTensor.to_list() is only supported in eager " |
| 1806 | "mode; in graph mode, evaluate the RaggedTensor first " |
| 1807 | "and then use RaggedTensorValue.to_list().") |
| 1808 | |
| 1809 | def _eager_value(self): |
| 1810 | """Returns a RaggedTensorValue for self. Requires self._is_eager()=true.""" |