tf.config.experimental_connect_to_host
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Connects to a single machine to enable remote execution on it.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
tf.compat.v1.config.experimental_connect_to_host
tf.config.experimental_connect_to_host(
remote_host=None, job_name='worker'
)
Will make devices on the remote host available to use. Note that calling this
more than once will work, but will invalidate any tensor handles on the old
remote devices.
Using the default job_name of worker, you can schedule ops to run remotely as
follows:
# When eager execution is enabled, connect to the remote host.
tf.config.experimental_connect_to_host("exampleaddr.com:9876")
with ops.device("job:worker/replica:0/task:1/device:CPU:0"):
# The following tensors should be resident on the remote device, and the op
# will also execute remotely.
x1 = array_ops.ones([2, 2])
x2 = array_ops.ones([2, 2])
y = math_ops.matmul(x1, x2)
Args |
remote_host
|
a single or a list the remote server addr in host-port format.
|
job_name
|
The job name under which the new server will be accessible.
|
Raises |
ValueError
|
if remote_host is None.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]