MCPcopy Create free account
hub / github.com/alibaba/nann / device

Function device

tensorflow/tensorflow/python/eager/context.py:1659–1680  ·  view source on GitHub ↗

Context-manager to force placement of operations and Tensors on a device. Example: ```python with tf.device('gpu:0'): with tf.device('cpu:0'): shape = tf.constant([], dtype=tf.int32) x = tf.random.truncated_normal(shape, tf.float32) ``` will ensure that the `shape` Tensor is

(name)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 3

ensure_initializedFunction · 0.85
contextFunction · 0.85
deviceMethod · 0.45

Tested by

no test coverage detected