MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / from_proto

Method from_proto

tensorflow/python/ops/control_flow_ops.py:1612–1627  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

WhileContextClass · 0.70
EnterMethod · 0.45
ExitMethod · 0.45

Tested by

no test coverage detected