ttnn.from_device

ttnn.from_device() None

Copies the ttnn.Tensor tensor to the host.

:param * tensor: the ttnn.Tensor

Example

# Open the device
# device_id = 0
# device = ttnn.open_device(device_id=device_id)

# Create a TT-NN tensor on the device and move it back to the host
ttnn_tensor_on_device = ttnn.rand((2, 3), dtype=ttnn.bfloat16, device=device)
ttnn_tensor_on_host = ttnn.from_device(ttnn_tensor_on_device)

logger.info("TT-NN tensor shape after moving from device to host", ttnn_tensor_on_host.shape)