Creates a new `CondContext` from protocol buffer. Args: context_def: `CondContextDef` protocol buffer. import_scope: Optional `string`. Name scope to add.
(self, context_def, import_scope=None)
| 846 | pivot.op._set_control_flow_context(self) # pylint: disable=protected-access |
| 847 | |
| 848 | def _init_from_proto(self, context_def, import_scope=None): |
| 849 | """Creates a new `CondContext` from protocol buffer. |
| 850 | |
| 851 | Args: |
| 852 | context_def: `CondContextDef` protocol buffer. |
| 853 | import_scope: Optional `string`. Name scope to add. |
| 854 | """ |
| 855 | assert isinstance(context_def, control_flow_pb2.CondContextDef) |
| 856 | # Create from context_def. |
| 857 | g = ops.get_default_graph() |
| 858 | self._name = ops.prepend_name_scope(context_def.context_name, import_scope) |
| 859 | self._pred = g.as_graph_element( |
| 860 | ops.prepend_name_scope(context_def.pred_name, import_scope)) |
| 861 | self._pivot = g.as_graph_element( |
| 862 | ops.prepend_name_scope(context_def.pivot_name, import_scope)) |
| 863 | self._branch = context_def.branch |
| 864 | super(CondContext, self).__init__( |
| 865 | values_def=context_def.values_def, import_scope=import_scope) |
| 866 | |
| 867 | @property |
| 868 | def pred(self): |
no test coverage detected