Creates a new single-process cluster running on the local host. This method is a convenience wrapper for creating a `tf.distribute.Server` with a `tf.train.ServerDef` that specifies a single-process cluster containing a single task in a job called `"local"`. Args: config:
(config=None, start=True)
| 214 | |
| 215 | @staticmethod |
| 216 | def create_local_server(config=None, start=True): |
| 217 | """Creates a new single-process cluster running on the local host. |
| 218 | |
| 219 | This method is a convenience wrapper for creating a |
| 220 | `tf.distribute.Server` with a `tf.train.ServerDef` that specifies a |
| 221 | single-process cluster containing a single task in a job called |
| 222 | `"local"`. |
| 223 | |
| 224 | Args: |
| 225 | config: (Options.) A `tf.compat.v1.ConfigProto` that specifies default |
| 226 | configuration options for all sessions that run on this server. |
| 227 | start: (Optional.) Boolean, indicating whether to start the server after |
| 228 | creating it. Defaults to `True`. |
| 229 | |
| 230 | Returns: |
| 231 | A local `tf.distribute.Server`. |
| 232 | """ |
| 233 | # Specifying port 0 means that the OS will choose a free port for the |
| 234 | # server. |
| 235 | return Server({"local": ["localhost:0"]}, |
| 236 | protocol="grpc", |
| 237 | config=config, |
| 238 | start=start) |
| 239 | |
| 240 | |
| 241 | @tf_export("train.ClusterSpec") |