We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
PS needs to init wrap initializer when embedding exists
For a PS that does not have non-embedding parameters, it needs to initialize wrap optimizer  if embedding layer exists.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `elasticdl/python/ps/servicer.py`
Content:
```
1 import threading
2 
3 from google.protobuf import empty_pb2
4 
5 from elasticdl.proto import elasticdl_pb2, elasticdl_pb2_grpc
6 from elasticdl.python.common.tensor import (
7     Tensor,
8     emplace_tensor_pb_from_ndarray,
9     serialize_tensor,
10 )
11 from elasticdl.python.master.optimizer_wrapper import OptimizerWrapper
12 
13 
14 class PserverServicer(elasticdl_pb2_grpc.PserverServicer):
15     """PS service implementation"""
16 
17     def __init__(
18         self,
19         parameters,
20         grads_to_wait,
21         optimizer,
22         lr_staleness_modulation=False,
23         use_async=False,
24         evaluation_steps=0,
25         master_channel=None,
26     ):
27         if master_channel is None:
28             self._master_stub = None
29         else:
30             self._master_stub = elasticdl_pb2_grpc.MasterStub(master_channel)
31 
32         self._parameters = parameters
33         self._grads_to_wait = grads_to_wait
34         self._optimizer = optimizer
35         self._lr_staleness_modulation = lr_staleness_modulation
36         self._use_async = use_async
37         self._eval_steps = evaluation_steps
38         self._version_lock = threading.Lock()
39         self._lock = threading.Lock()
40 
41         self._grads_n = 0
42         self._grads_buffer = {}
43 
44     def pull_variable(self, request, _):
45         """
46         Response with all non-embedding parameters if initialized.
47         """
48         res = elasticdl_pb2.PullVariableResponse()
49         if not self._parameters.init_status:
50             res.model_init_status = False
51             return res
52 
53         # Only sync-SGD needs lock
54         # TODO: use a read-write lock to support multiple concurrent reads
55         if not self._use_async:
56             self._lock.acquire()
57         res.model.version = self._parameters.version
58         for name, var in self._parameters.non_embedding_params.items():
59             emplace_tensor_pb_from_ndarray(
60                 res.model.param, var.numpy(), name=name
61             )
62         if not self._use_async:
63             self._lock.release()
64         res.model_init_status = True
65         return res
66 
67     def pull_embedding_vector(self, request, _):
68         ret = elasticdl_pb2.Tensor()
69         if not request.ids:
70             return ret
71         embedding_vectors = self._parameters.get_embedding_param(
72             request.name, request.ids
73         )
74         tensor = Tensor(values=embedding_vectors)
75         serialize_tensor(tensor, ret)
76         return ret
77 
78     def push_model(self, request, _):
79         with self._lock:
80             accepted = self._parameters.init_from_model_pb(request)
81         if accepted and self._parameters.has_embedding_params():
82             self.wrap_optimizer()
83             self._parameters.create_slot_params(
84                 self._optimizer.allowed_slot_names,
85                 self._optimizer.slot_initial_value,
86             )
87         return empty_pb2.Empty()
88 
89     def push_embedding_info(self, request, _):
90         with self._lock:
91             self._parameters.init_embedding_params(
92                 request.embedding_table_info
93             )
94         return empty_pb2.Empty()
95 
96     def push_gradient(self, request, _):
97         res = elasticdl_pb2.PushGradientResponse()
98         if self._use_async:
99             grad_vars = []
100             for pb in request.gradients:
101                 grad = Tensor.from_tensor_pb(pb)
102                 self._parameters.check_grad(grad)
103                 name = grad.name
104                 var = self._parameters.get_non_embedding_param(name)
105                 grad = grad.to_tf_tensor()
106                 if var is None:
107                     grad_vars.append((grad, name))
108                 else:
109                     grad_vars.append((grad, var))
110 
111             self._optimizer.apply_gradients(grad_vars)
112             with self._version_lock:
113                 self._parameters.version += 1
114                 version = self._parameters.version
115             self._report_version_if_needed(version)
116 
117             res.accepted = True
118             res.model_version = self._parameters.version
119             return res
120         else:
121             if request.model_version != self._parameters.version:
122                 res.accepted = False
123                 res.model_version = self._parameters.version
124                 return res
125 
126             with self._lock:
127                 for pb in request.gradients:
128                     grad = Tensor.from_tensor_pb(pb)
129                     self._parameters.check_grad(grad)
130                     if grad.name in self._grads_buffer:
131                         self._grads_buffer[grad.name] = (
132                             self._grads_buffer[grad.name] + grad
133                         )
134                     else:
135                         self._grads_buffer[grad.name] = grad
136 
137                 self._grads_n += 1
138                 res.accepted = True
139 
140                 updated_version = False
141                 version = self._parameters.version
142                 if self._grads_n == self._grads_to_wait:
143                     grad_vars = []
144                     for name, grad in self._grads_buffer.items():
145                         # Dense gradients are averaged,
146                         # while sparse gradients are summed
147                         if not grad.is_indexed_slices():
148                             grad.values = grad.values / self._grads_to_wait
149                         var = self._parameters.get_non_embedding_param(name)
150                         grad = grad.to_tf_tensor()
151                         if var is None:
152                             grad_vars.append((grad, name))
153                         else:
154                             grad_vars.append((grad, var))
155 
156                     self._optimizer.apply_gradients(grad_vars)
157                     self._grads_n = 0
158                     self._grads_buffer.clear()
159                     self._parameters.version += 1
160                     version = self._parameters.version
161                     updated_version = True
162 
163             if updated_version:
164                 self._report_version_if_needed(version)
165             res.model_version = version
166             return res
167 
168     def wrap_optimizer(self):
169         # TODO(yunjian.lmh): refine these arguments when we don't need
170         # to support using Redis as distributed KV storage.
171         embedding_dims = {}
172         for table in self._parameters.embedding_params.values():
173             embedding_dims[table.name] = table.dim
174         embedding_service_endpoint = None
175 
176         def lookup_embedding_func(keys):
177             embeddings = []
178             for key in keys:
179                 arrs = key.split("-")
180                 layer_name = "-".join(arrs[:-1])
181                 id = int(arrs[-1])
182                 embedding = self._parameters.get_embedding_param(
183                     layer_name, [id]
184                 )
185                 embeddings.append(embedding.flatten())
186             return embeddings, []
187 
188         def update_embedding_func(keys, values):
189             for key, value in zip(keys, values):
190                 arrs = key.split("-")
191                 layer_name = "-".join(arrs[:-1])
192                 id = int(arrs[-1])
193                 self._parameters.set_embedding_param(layer_name, [id], [value])
194 
195         self._optimizer = OptimizerWrapper(
196             self._optimizer,
197             embedding_service_endpoint,
198             embedding_dims,
199             self._use_async,
200             lookup_embedding_func,
201             update_embedding_func,
202         )
203 
204     def _report_version_if_needed(self, version):
205         if self._eval_steps and version % self._eval_steps == 0:
206             self._report_version(version)
207 
208     def _report_version(self, version):
209         req = elasticdl_pb2.ReportVersionRequest()
210         req.model_version = version
211         self._master_stub.ReportVersion(req)
212
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/elasticdl/python/ps/servicer.py b/elasticdl/python/ps/servicer.py
--- a/elasticdl/python/ps/servicer.py
+++ b/elasticdl/python/ps/servicer.py
@@ -37,6 +37,7 @@
         self._eval_steps = evaluation_steps
         self._version_lock = threading.Lock()
         self._lock = threading.Lock()
+        self._use_wrap_opt = False
 
         self._grads_n = 0
         self._grads_buffer = {}
@@ -79,11 +80,7 @@
         with self._lock:
             accepted = self._parameters.init_from_model_pb(request)
         if accepted and self._parameters.has_embedding_params():
-            self.wrap_optimizer()
-            self._parameters.create_slot_params(
-                self._optimizer.allowed_slot_names,
-                self._optimizer.slot_initial_value,
-            )
+            self.wrap_optimizer_and_set_slot()
         return empty_pb2.Empty()
 
     def push_embedding_info(self, request, _):
@@ -91,6 +88,7 @@
             self._parameters.init_embedding_params(
                 request.embedding_table_info
             )
+            self.wrap_optimizer_and_set_slot()
         return empty_pb2.Empty()
 
     def push_gradient(self, request, _):
@@ -209,3 +207,12 @@
         req = elasticdl_pb2.ReportVersionRequest()
         req.model_version = version
         self._master_stub.ReportVersion(req)
+
+    def wrap_optimizer_and_set_slot(self):
+        if not self._use_wrap_opt:
+            self.wrap_optimizer()
+            self._parameters.create_slot_params(
+                self._optimizer.allowed_slot_names,
+                self._optimizer.slot_initial_value,
+            )
+            self._use_wrap_opt = True

{"golden_diff": "diff --git a/elasticdl/python/ps/servicer.py b/elasticdl/python/ps/servicer.py\n--- a/elasticdl/python/ps/servicer.py\n+++ b/elasticdl/python/ps/servicer.py\n@@ -37,6 +37,7 @@\n         self._eval_steps = evaluation_steps\n         self._version_lock = threading.Lock()\n         self._lock = threading.Lock()\n+        self._use_wrap_opt = False\n \n         self._grads_n = 0\n         self._grads_buffer = {}\n@@ -79,11 +80,7 @@\n         with self._lock:\n             accepted = self._parameters.init_from_model_pb(request)\n         if accepted and self._parameters.has_embedding_params():\n-            self.wrap_optimizer()\n-            self._parameters.create_slot_params(\n-                self._optimizer.allowed_slot_names,\n-                self._optimizer.slot_initial_value,\n-            )\n+            self.wrap_optimizer_and_set_slot()\n         return empty_pb2.Empty()\n \n     def push_embedding_info(self, request, _):\n@@ -91,6 +88,7 @@\n             self._parameters.init_embedding_params(\n                 request.embedding_table_info\n             )\n+            self.wrap_optimizer_and_set_slot()\n         return empty_pb2.Empty()\n \n     def push_gradient(self, request, _):\n@@ -209,3 +207,12 @@\n         req = elasticdl_pb2.ReportVersionRequest()\n         req.model_version = version\n         self._master_stub.ReportVersion(req)\n+\n+    def wrap_optimizer_and_set_slot(self):\n+        if not self._use_wrap_opt:\n+            self.wrap_optimizer()\n+            self._parameters.create_slot_params(\n+                self._optimizer.allowed_slot_names,\n+                self._optimizer.slot_initial_value,\n+            )\n+            self._use_wrap_opt = True\n", "issue": "PS needs to init wrap initializer when embedding exists\nFor a PS that does not have non-embedding parameters, it needs to initialize wrap optimizer  if embedding layer exists.\n", "before_files": [{"content": "import threading\n\nfrom google.protobuf import empty_pb2\n\nfrom elasticdl.proto import elasticdl_pb2, elasticdl_pb2_grpc\nfrom elasticdl.python.common.tensor import (\n    Tensor,\n    emplace_tensor_pb_from_ndarray,\n    serialize_tensor,\n)\nfrom elasticdl.python.master.optimizer_wrapper import OptimizerWrapper\n\n\nclass PserverServicer(elasticdl_pb2_grpc.PserverServicer):\n    \"\"\"PS service implementation\"\"\"\n\n    def __init__(\n        self,\n        parameters,\n        grads_to_wait,\n        optimizer,\n        lr_staleness_modulation=False,\n        use_async=False,\n        evaluation_steps=0,\n        master_channel=None,\n    ):\n        if master_channel is None:\n            self._master_stub = None\n        else:\n            self._master_stub = elasticdl_pb2_grpc.MasterStub(master_channel)\n\n        self._parameters = parameters\n        self._grads_to_wait = grads_to_wait\n        self._optimizer = optimizer\n        self._lr_staleness_modulation = lr_staleness_modulation\n        self._use_async = use_async\n        self._eval_steps = evaluation_steps\n        self._version_lock = threading.Lock()\n        self._lock = threading.Lock()\n\n        self._grads_n = 0\n        self._grads_buffer = {}\n\n    def pull_variable(self, request, _):\n        \"\"\"\n        Response with all non-embedding parameters if initialized.\n        \"\"\"\n        res = elasticdl_pb2.PullVariableResponse()\n        if not self._parameters.init_status:\n            res.model_init_status = False\n            return res\n\n        # Only sync-SGD needs lock\n        # TODO: use a read-write lock to support multiple concurrent reads\n        if not self._use_async:\n            self._lock.acquire()\n        res.model.version = self._parameters.version\n        for name, var in self._parameters.non_embedding_params.items():\n            emplace_tensor_pb_from_ndarray(\n                res.model.param, var.numpy(), name=name\n            )\n        if not self._use_async:\n            self._lock.release()\n        res.model_init_status = True\n        return res\n\n    def pull_embedding_vector(self, request, _):\n        ret = elasticdl_pb2.Tensor()\n        if not request.ids:\n            return ret\n        embedding_vectors = self._parameters.get_embedding_param(\n            request.name, request.ids\n        )\n        tensor = Tensor(values=embedding_vectors)\n        serialize_tensor(tensor, ret)\n        return ret\n\n    def push_model(self, request, _):\n        with self._lock:\n            accepted = self._parameters.init_from_model_pb(request)\n        if accepted and self._parameters.has_embedding_params():\n            self.wrap_optimizer()\n            self._parameters.create_slot_params(\n                self._optimizer.allowed_slot_names,\n                self._optimizer.slot_initial_value,\n            )\n        return empty_pb2.Empty()\n\n    def push_embedding_info(self, request, _):\n        with self._lock:\n            self._parameters.init_embedding_params(\n                request.embedding_table_info\n            )\n        return empty_pb2.Empty()\n\n    def push_gradient(self, request, _):\n        res = elasticdl_pb2.PushGradientResponse()\n        if self._use_async:\n            grad_vars = []\n            for pb in request.gradients:\n                grad = Tensor.from_tensor_pb(pb)\n                self._parameters.check_grad(grad)\n                name = grad.name\n                var = self._parameters.get_non_embedding_param(name)\n                grad = grad.to_tf_tensor()\n                if var is None:\n                    grad_vars.append((grad, name))\n                else:\n                    grad_vars.append((grad, var))\n\n            self._optimizer.apply_gradients(grad_vars)\n            with self._version_lock:\n                self._parameters.version += 1\n                version = self._parameters.version\n            self._report_version_if_needed(version)\n\n            res.accepted = True\n            res.model_version = self._parameters.version\n            return res\n        else:\n            if request.model_version != self._parameters.version:\n                res.accepted = False\n                res.model_version = self._parameters.version\n                return res\n\n            with self._lock:\n                for pb in request.gradients:\n                    grad = Tensor.from_tensor_pb(pb)\n                    self._parameters.check_grad(grad)\n                    if grad.name in self._grads_buffer:\n                        self._grads_buffer[grad.name] = (\n                            self._grads_buffer[grad.name] + grad\n                        )\n                    else:\n                        self._grads_buffer[grad.name] = grad\n\n                self._grads_n += 1\n                res.accepted = True\n\n                updated_version = False\n                version = self._parameters.version\n                if self._grads_n == self._grads_to_wait:\n                    grad_vars = []\n                    for name, grad in self._grads_buffer.items():\n                        # Dense gradients are averaged,\n                        # while sparse gradients are summed\n                        if not grad.is_indexed_slices():\n                            grad.values = grad.values / self._grads_to_wait\n                        var = self._parameters.get_non_embedding_param(name)\n                        grad = grad.to_tf_tensor()\n                        if var is None:\n                            grad_vars.append((grad, name))\n                        else:\n                            grad_vars.append((grad, var))\n\n                    self._optimizer.apply_gradients(grad_vars)\n                    self._grads_n = 0\n                    self._grads_buffer.clear()\n                    self._parameters.version += 1\n                    version = self._parameters.version\n                    updated_version = True\n\n            if updated_version:\n                self._report_version_if_needed(version)\n            res.model_version = version\n            return res\n\n    def wrap_optimizer(self):\n        # TODO(yunjian.lmh): refine these arguments when we don't need\n        # to support using Redis as distributed KV storage.\n        embedding_dims = {}\n        for table in self._parameters.embedding_params.values():\n            embedding_dims[table.name] = table.dim\n        embedding_service_endpoint = None\n\n        def lookup_embedding_func(keys):\n            embeddings = []\n            for key in keys:\n                arrs = key.split(\"-\")\n                layer_name = \"-\".join(arrs[:-1])\n                id = int(arrs[-1])\n                embedding = self._parameters.get_embedding_param(\n                    layer_name, [id]\n                )\n                embeddings.append(embedding.flatten())\n            return embeddings, []\n\n        def update_embedding_func(keys, values):\n            for key, value in zip(keys, values):\n                arrs = key.split(\"-\")\n                layer_name = \"-\".join(arrs[:-1])\n                id = int(arrs[-1])\n                self._parameters.set_embedding_param(layer_name, [id], [value])\n\n        self._optimizer = OptimizerWrapper(\n            self._optimizer,\n            embedding_service_endpoint,\n            embedding_dims,\n            self._use_async,\n            lookup_embedding_func,\n            update_embedding_func,\n        )\n\n    def _report_version_if_needed(self, version):\n        if self._eval_steps and version % self._eval_steps == 0:\n            self._report_version(version)\n\n    def _report_version(self, version):\n        req = elasticdl_pb2.ReportVersionRequest()\n        req.model_version = version\n        self._master_stub.ReportVersion(req)\n", "path": "elasticdl/python/ps/servicer.py"}], "after_files": [{"content": "import threading\n\nfrom google.protobuf import empty_pb2\n\nfrom elasticdl.proto import elasticdl_pb2, elasticdl_pb2_grpc\nfrom elasticdl.python.common.tensor import (\n    Tensor,\n    emplace_tensor_pb_from_ndarray,\n    serialize_tensor,\n)\nfrom elasticdl.python.master.optimizer_wrapper import OptimizerWrapper\n\n\nclass PserverServicer(elasticdl_pb2_grpc.PserverServicer):\n    \"\"\"PS service implementation\"\"\"\n\n    def __init__(\n        self,\n        parameters,\n        grads_to_wait,\n        optimizer,\n        lr_staleness_modulation=False,\n        use_async=False,\n        evaluation_steps=0,\n        master_channel=None,\n    ):\n        if master_channel is None:\n            self._master_stub = None\n        else:\n            self._master_stub = elasticdl_pb2_grpc.MasterStub(master_channel)\n\n        self._parameters = parameters\n        self._grads_to_wait = grads_to_wait\n        self._optimizer = optimizer\n        self._lr_staleness_modulation = lr_staleness_modulation\n        self._use_async = use_async\n        self._eval_steps = evaluation_steps\n        self._version_lock = threading.Lock()\n        self._lock = threading.Lock()\n        self._use_wrap_opt = False\n\n        self._grads_n = 0\n        self._grads_buffer = {}\n\n    def pull_variable(self, request, _):\n        \"\"\"\n        Response with all non-embedding parameters if initialized.\n        \"\"\"\n        res = elasticdl_pb2.PullVariableResponse()\n        if not self._parameters.init_status:\n            res.model_init_status = False\n            return res\n\n        # Only sync-SGD needs lock\n        # TODO: use a read-write lock to support multiple concurrent reads\n        if not self._use_async:\n            self._lock.acquire()\n        res.model.version = self._parameters.version\n        for name, var in self._parameters.non_embedding_params.items():\n            emplace_tensor_pb_from_ndarray(\n                res.model.param, var.numpy(), name=name\n            )\n        if not self._use_async:\n            self._lock.release()\n        res.model_init_status = True\n        return res\n\n    def pull_embedding_vector(self, request, _):\n        ret = elasticdl_pb2.Tensor()\n        if not request.ids:\n            return ret\n        embedding_vectors = self._parameters.get_embedding_param(\n            request.name, request.ids\n        )\n        tensor = Tensor(values=embedding_vectors)\n        serialize_tensor(tensor, ret)\n        return ret\n\n    def push_model(self, request, _):\n        with self._lock:\n            accepted = self._parameters.init_from_model_pb(request)\n        if accepted and self._parameters.has_embedding_params():\n            self.wrap_optimizer_and_set_slot()\n        return empty_pb2.Empty()\n\n    def push_embedding_info(self, request, _):\n        with self._lock:\n            self._parameters.init_embedding_params(\n                request.embedding_table_info\n            )\n            self.wrap_optimizer_and_set_slot()\n        return empty_pb2.Empty()\n\n    def push_gradient(self, request, _):\n        res = elasticdl_pb2.PushGradientResponse()\n        if self._use_async:\n            grad_vars = []\n            for pb in request.gradients:\n                grad = Tensor.from_tensor_pb(pb)\n                self._parameters.check_grad(grad)\n                name = grad.name\n                var = self._parameters.get_non_embedding_param(name)\n                grad = grad.to_tf_tensor()\n                if var is None:\n                    grad_vars.append((grad, name))\n                else:\n                    grad_vars.append((grad, var))\n\n            self._optimizer.apply_gradients(grad_vars)\n            with self._version_lock:\n                self._parameters.version += 1\n                version = self._parameters.version\n            self._report_version_if_needed(version)\n\n            res.accepted = True\n            res.model_version = self._parameters.version\n            return res\n        else:\n            if request.model_version != self._parameters.version:\n                res.accepted = False\n                res.model_version = self._parameters.version\n                return res\n\n            with self._lock:\n                for pb in request.gradients:\n                    grad = Tensor.from_tensor_pb(pb)\n                    self._parameters.check_grad(grad)\n                    if grad.name in self._grads_buffer:\n                        self._grads_buffer[grad.name] = (\n                            self._grads_buffer[grad.name] + grad\n                        )\n                    else:\n                        self._grads_buffer[grad.name] = grad\n\n                self._grads_n += 1\n                res.accepted = True\n\n                updated_version = False\n                version = self._parameters.version\n                if self._grads_n == self._grads_to_wait:\n                    grad_vars = []\n                    for name, grad in self._grads_buffer.items():\n                        # Dense gradients are averaged,\n                        # while sparse gradients are summed\n                        if not grad.is_indexed_slices():\n                            grad.values = grad.values / self._grads_to_wait\n                        var = self._parameters.get_non_embedding_param(name)\n                        grad = grad.to_tf_tensor()\n                        if var is None:\n                            grad_vars.append((grad, name))\n                        else:\n                            grad_vars.append((grad, var))\n\n                    self._optimizer.apply_gradients(grad_vars)\n                    self._grads_n = 0\n                    self._grads_buffer.clear()\n                    self._parameters.version += 1\n                    version = self._parameters.version\n                    updated_version = True\n\n            if updated_version:\n                self._report_version_if_needed(version)\n            res.model_version = version\n            return res\n\n    def wrap_optimizer(self):\n        # TODO(yunjian.lmh): refine these arguments when we don't need\n        # to support using Redis as distributed KV storage.\n        embedding_dims = {}\n        for table in self._parameters.embedding_params.values():\n            embedding_dims[table.name] = table.dim\n        embedding_service_endpoint = None\n\n        def lookup_embedding_func(keys):\n            embeddings = []\n            for key in keys:\n                arrs = key.split(\"-\")\n                layer_name = \"-\".join(arrs[:-1])\n                id = int(arrs[-1])\n                embedding = self._parameters.get_embedding_param(\n                    layer_name, [id]\n                )\n                embeddings.append(embedding.flatten())\n            return embeddings, []\n\n        def update_embedding_func(keys, values):\n            for key, value in zip(keys, values):\n                arrs = key.split(\"-\")\n                layer_name = \"-\".join(arrs[:-1])\n                id = int(arrs[-1])\n                self._parameters.set_embedding_param(layer_name, [id], [value])\n\n        self._optimizer = OptimizerWrapper(\n            self._optimizer,\n            embedding_service_endpoint,\n            embedding_dims,\n            self._use_async,\n            lookup_embedding_func,\n            update_embedding_func,\n        )\n\n    def _report_version_if_needed(self, version):\n        if self._eval_steps and version % self._eval_steps == 0:\n            self._report_version(version)\n\n    def _report_version(self, version):\n        req = elasticdl_pb2.ReportVersionRequest()\n        req.model_version = version\n        self._master_stub.ReportVersion(req)\n\n    def wrap_optimizer_and_set_slot(self):\n        if not self._use_wrap_opt:\n            self.wrap_optimizer()\n            self._parameters.create_slot_params(\n                self._optimizer.allowed_slot_names,\n                self._optimizer.slot_initial_value,\n            )\n            self._use_wrap_opt = True\n", "path": "elasticdl/python/ps/servicer.py"}]}