Set device filters for selective jobs and tasks. For each remote worker, the
device filters are a list of strings. When any filters are present, the remote
worker will ignore all devices which do not match any of its filters. Each
filter can be partially specified, e.g. "/job:ps", "/job:worker/replica:3",
etc. Note that a device is always visible to the worker it is located on.
For example, to set the device filters for a parameter server cluster:
[[["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 2021-02-18 UTC."],[],[],null,["# tf.config.experimental.ClusterDeviceFilters\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.4.0/tensorflow/python/training/server_lib.py#L500-L578) |\n\nRepresent a collection of device filters for the remote workers in cluster.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.config.experimental.ClusterDeviceFilters`](https://www.tensorflow.org/api_docs/python/tf/config/experimental/ClusterDeviceFilters)\n\n\u003cbr /\u003e\n\n tf.config.experimental.ClusterDeviceFilters()\n\n| **Note:** this is an experimental API and subject to changes.\n\nSet device filters for selective jobs and tasks. For each remote worker, the\ndevice filters are a list of strings. When any filters are present, the remote\nworker will ignore all devices which do not match any of its filters. Each\nfilter can be partially specified, e.g. \"/job:ps\", \"/job:worker/replica:3\",\netc. Note that a device is always visible to the worker it is located on.\n\nFor example, to set the device filters for a parameter server cluster: \n\n cdf = tf.config.experimental.ClusterDeviceFilters()\n for i in range(num_workers):\n cdf.set_device_filters('worker', i, ['/job:ps'])\n for i in range(num_ps):\n cdf.set_device_filters('ps', i, ['/job:worker'])\n\n tf.config.experimental_connect_to_cluster(cluster_def,\n cluster_device_filters=cdf)\n\nThe device filters can be partically specified. For remote tasks that do not\nhave device filters specified, all devices will be visible to them.\n\nMethods\n-------\n\n### `set_device_filters`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.4.0/tensorflow/python/training/server_lib.py#L537-L543) \n\n set_device_filters(\n job_name, task_index, device_filters\n )\n\nSet the device filters for given job name and task id."]]