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

Method _copy_nograd

tensorflow/python/framework/ops.py:998–1011  ·  view source on GitHub ↗

Copies tensor to dest device, but doesn't record the operation.

(self, ctx=None, device_name=None)

Source from the content-addressed store, hash-verified

996 setattr(_EagerTensorBase, name, func)
997
998 def _copy_nograd(self, ctx=None, device_name=None):
999 """Copies tensor to dest device, but doesn't record the operation."""
1000 # Creates a new tensor on the dest device.
1001 if ctx is None:
1002 ctx = context.context()
1003 if device_name is None:
1004 device_name = ctx.device_name
1005 # pylint: disable=protected-access
1006 try:
1007 ctx.ensure_initialized()
1008 new_tensor = self._copy_to_device(device_name)
1009 except core._NotOkStatusException as e:
1010 six.raise_from(core._status_to_exception(e.code, e.message), None)
1011 return new_tensor
1012
1013 def _copy(self, ctx=None, device_name=None):
1014 """Copies tensor to dest device."""

Callers 1

_copyMethod · 0.95

Calls 3

_copy_to_deviceMethod · 0.95
ensure_initializedMethod · 0.80
contextMethod · 0.45

Tested by

no test coverage detected