Evaluate by :code:`sess.run`. Args: leaf (bool, optional): Leaf Operation means there is no successor.
(self, leaf=True)
| 136 | return self._leaf |
| 137 | |
| 138 | def eval(self, leaf=True): |
| 139 | """Evaluate by :code:`sess.run`. |
| 140 | |
| 141 | Args: |
| 142 | leaf (bool, optional): Leaf Operation means there is no successor. |
| 143 | """ |
| 144 | # NB: to void cycle import |
| 145 | # pylint: disable=import-outside-toplevel, cyclic-import |
| 146 | from graphscope.client.session import get_session_by_id |
| 147 | |
| 148 | self._leaf = leaf |
| 149 | sess = get_session_by_id(self._session_id) |
| 150 | if not self._leaf: |
| 151 | sess.dag.add_op(self) |
| 152 | res = sess.run(self) |
| 153 | self._evaluated = True |
| 154 | return res |
| 155 | |
| 156 | def add_parent(self, op): |
| 157 | self._parents.append(op) |
no test coverage detected