Returns a `WhileContext` object created from `context_def`. Args: context_def: A `WhileContextDef` protocol buffer. import_scope: Optional `string`. Name scope to add. Returns: A `WhileContext` Python object.
(context_def, import_scope=None)
| 1610 | |
| 1611 | @staticmethod |
| 1612 | def from_proto(context_def, import_scope=None): |
| 1613 | """Returns a `WhileContext` object created from `context_def`. |
| 1614 | |
| 1615 | Args: |
| 1616 | context_def: A `WhileContextDef` protocol buffer. |
| 1617 | import_scope: Optional `string`. Name scope to add. |
| 1618 | |
| 1619 | Returns: |
| 1620 | A `WhileContext` Python object. |
| 1621 | """ |
| 1622 | ret = WhileContext(context_def=context_def, import_scope=import_scope) |
| 1623 | ret.Enter() |
| 1624 | for nested_def in context_def.nested_contexts: |
| 1625 | from_control_flow_context_def(nested_def, import_scope=import_scope) |
| 1626 | ret.Exit() |
| 1627 | return ret |
| 1628 | |
| 1629 | def GetWhileContext(self): |
| 1630 | return self |
nothing calls this directly
no test coverage detected