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

Method _add_new_tf_operations

tensorflow/python/framework/ops.py:3553–3582  ·  view source on GitHub ↗

Creates `Operations` in this graph for any new TF_Operations. This is useful for when TF_Operations are indirectly created by the C API outside of the Operation constructor (e.g. by TF_ImportGraphDef, TF_FinishWhile). This ensures there are corresponding Operations for all TF_Operat

(self, compute_devices=True)

Source from the content-addressed store, hash-verified

3551 s=compat.as_bytes(self._container)))
3552
3553 def _add_new_tf_operations(self, compute_devices=True):
3554 """Creates `Operations` in this graph for any new TF_Operations.
3555
3556 This is useful for when TF_Operations are indirectly created by the C API
3557 outside of the Operation constructor (e.g. by TF_ImportGraphDef,
3558 TF_FinishWhile). This ensures there are corresponding Operations for all
3559 TF_Operations in the underlying TF_Graph.
3560
3561 Args:
3562 compute_devices: (Optional.) If True, device functions will be executed to
3563 compute the device properties of each new Operation.
3564
3565 Returns:
3566 A list of the new `Operation` objects.
3567 """
3568 # Create all Operation objects before accessing their inputs since an op may
3569 # be created before its inputs.
3570 new_ops = [
3571 self._create_op_from_tf_operation(c_op, compute_device=compute_devices)
3572 for c_op in c_api_util.new_tf_operations(self)
3573 ]
3574
3575 # pylint: disable=protected-access
3576 for op in new_ops:
3577 new_control_inputs = self._control_dependencies_for_inputs(op.inputs)
3578 op._add_control_inputs(new_control_inputs)
3579 op._control_flow_post_processing()
3580 # pylint: enable=protected-access
3581
3582 return new_ops
3583
3584 def as_graph_element(self, obj, allow_tensor=True, allow_operation=True):
3585 """Returns the object referred to by `obj`, as an `Operation` or `Tensor`.

Callers 3

true_fnMethod · 0.80
bodyMethod · 0.80
_ProcessNewOpsFunction · 0.80

Tested by 2

true_fnMethod · 0.64
bodyMethod · 0.64