Returns a `CondContext` object created from `context_def`.
(context_def, import_scope=None)
| 920 | |
| 921 | @staticmethod |
| 922 | def from_proto(context_def, import_scope=None): |
| 923 | """Returns a `CondContext` object created from `context_def`.""" |
| 924 | ret = CondContext(context_def=context_def, import_scope=import_scope) |
| 925 | |
| 926 | ret.Enter() |
| 927 | for nested_def in context_def.nested_contexts: |
| 928 | from_control_flow_context_def(nested_def, import_scope=import_scope) |
| 929 | ret.Exit() |
| 930 | return ret |
| 931 | |
| 932 | def to_control_flow_context_def(self, context_def, export_scope=None): |
| 933 | context_def.cond_ctxt.CopyFrom(self.to_proto(export_scope=export_scope)) |
no test coverage detected