We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Potential bug in SVT?
Hi all, 
is this intended that in [line 103](https://github.com/NVIDIA/NVFlare/blob/e5e8c15a3455c81cb16268fbaafeef3f26d2b195/nvflare/app_common/filters/svt_privacy.py#L103) of the SVTPrivacy class, only a random choice of the accepted parameters is taken with replacement? This will lead to a lower number of accepted and candidate parameters ([Line 108](https://github.com/NVIDIA/NVFlare/blob/e5e8c15a3455c81cb16268fbaafeef3f26d2b195/nvflare/app_common/filters/svt_privacy.py#L108)) than originally computed. 

So even if I am running SVT it with a fraction of 1.0, not all of my noisy values (3.491.530) are transferred, but around 1.284.489 of them are set to 0. 


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `nvflare/app_common/filters/svt_privacy.py`
Content:
```
1 # Copyright (c) 2021-2022, NVIDIA CORPORATION.  All rights reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 from typing import Union
16 
17 import numpy as np
18 
19 from nvflare.apis.dxo import DXO, DataKind, MetaKey
20 from nvflare.apis.dxo_filter import DXOFilter
21 from nvflare.apis.fl_context import FLContext
22 from nvflare.apis.shareable import Shareable
23 
24 
25 class SVTPrivacy(DXOFilter):
26     def __init__(self, fraction=0.1, epsilon=0.1, noise_var=0.1, gamma=1e-5, tau=1e-6, data_kinds: [str] = None):
27         """Implementation of the standard Sparse Vector Technique (SVT) differential privacy algorithm.
28 
29         lambda_rho = gamma * 2.0 / epsilon
30         threshold = tau + np.random.laplace(scale=lambda_rho)
31 
32         Args:
33             fraction (float, optional): used to determine dataset threshold. Defaults to 0.1.
34             epsilon (float, optional): Defaults to 0.1.
35             noise_var (float, optional): additive noise. Defaults to 0.1.
36             gamma (float, optional): Defaults to 1e-5.
37             tau (float, optional): Defaults to 1e-6.
38         """
39         if not data_kinds:
40             data_kinds = [DataKind.WEIGHT_DIFF, DataKind.WEIGHTS]
41 
42         super().__init__(supported_data_kinds=[DataKind.WEIGHTS, DataKind.WEIGHT_DIFF], data_kinds_to_filter=data_kinds)
43 
44         self.frac = fraction  # fraction of the model to upload
45         self.eps_1 = epsilon
46         self.eps_2 = None  # to be derived from eps_1
47         self.eps_3 = noise_var
48         self.gamma = gamma
49         self.tau = tau
50 
51     def process_dxo(self, dxo: DXO, shareable: Shareable, fl_ctx: FLContext) -> Union[None, DXO]:
52         """Compute the differentially private SVT.
53 
54         Args:
55             dxo: information from client
56             shareable: that the dxo belongs to
57             fl_ctx: context provided by workflow
58 
59         Returns: filtered result.
60         """
61         self.log_debug(fl_ctx, "inside filter")
62         model_diff = dxo.data
63         total_steps = dxo.get_meta_prop(MetaKey.NUM_STEPS_CURRENT_ROUND, 1)
64 
65         delta_w = np.concatenate([model_diff[name].ravel() / np.float(total_steps) for name in sorted(model_diff)])
66         self.log_info(
67             fl_ctx,
68             "Delta_w: Max abs: {}, Min abs: {}, Median abs: {}.".format(
69                 np.max(np.abs(delta_w)), np.min(np.abs(delta_w)), np.median(np.abs(delta_w))
70             ),
71         )
72 
73         # precompute thresholds
74         n_upload = np.minimum(np.ceil(np.float(delta_w.size) * self.frac), np.float(delta_w.size))
75 
76         # eps_1: threshold with noise
77         lambda_rho = self.gamma * 2.0 / self.eps_1
78         threshold = self.tau + np.random.laplace(scale=lambda_rho)
79         # eps_2: query with noise
80         self.eps_2 = self.eps_1 * (2.0 * n_upload) ** (2.0 / 3.0)
81         lambda_nu = self.gamma * 4.0 * n_upload / self.eps_2
82         self.logger.info(
83             "total params: %s, epsilon: %s, "
84             "perparam budget %s, threshold tau: %s + f(eps_1) = %s, "
85             "clip gamma: %s",
86             delta_w.size,
87             self.eps_1,
88             self.eps_1 / n_upload,
89             self.tau,
90             threshold,
91             self.gamma,
92         )
93 
94         # selecting weights with additive noise
95         accepted, candidate_idx = [], np.arange(delta_w.size)
96         _clipped_w = np.abs(np.clip(delta_w, a_min=-self.gamma, a_max=self.gamma))
97         while len(accepted) < n_upload:
98             nu_i = np.random.laplace(scale=lambda_nu, size=candidate_idx.shape)
99             above_threshold = (_clipped_w[candidate_idx] + nu_i) >= threshold
100             accepted += candidate_idx[above_threshold].tolist()
101             candidate_idx = candidate_idx[~above_threshold]
102             self.log_info(fl_ctx, "selected {} responses, requested {}".format(len(accepted), n_upload))
103         accepted = np.random.choice(accepted, size=np.int64(n_upload))
104         # eps_3 return with noise
105         noise = np.random.laplace(scale=self.gamma * 2.0 / self.eps_3, size=accepted.shape)
106         self.log_info(fl_ctx, "noise max: {}, median {}".format(np.max(np.abs(noise)), np.median(np.abs(noise))))
107         delta_w[accepted] = np.clip(delta_w[accepted] + noise, a_min=-self.gamma, a_max=self.gamma)
108         candidate_idx = list(set(np.arange(delta_w.size)) - set(accepted))
109         delta_w[candidate_idx] = 0.0
110 
111         # resume original format
112         dp_w, _start = {}, 0
113         for name in sorted(model_diff):
114             if np.ndim(model_diff[name]) == 0:
115                 dp_w[name] = model_diff[name]
116                 _start += 1
117                 continue
118             value = delta_w[_start : (_start + model_diff[name].size)]
119             dp_w[name] = value.reshape(model_diff[name].shape) * np.float(total_steps)
120             _start += model_diff[name].size
121 
122         # We update the shareable weights only.  Headers are unchanged.
123         dxo.data = dp_w
124         return dxo
125
```
--- 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/nvflare/app_common/filters/svt_privacy.py b/nvflare/app_common/filters/svt_privacy.py
--- a/nvflare/app_common/filters/svt_privacy.py
+++ b/nvflare/app_common/filters/svt_privacy.py
@@ -23,7 +23,9 @@
 
 
 class SVTPrivacy(DXOFilter):
-    def __init__(self, fraction=0.1, epsilon=0.1, noise_var=0.1, gamma=1e-5, tau=1e-6, data_kinds: [str] = None):
+    def __init__(
+        self, fraction=0.1, epsilon=0.1, noise_var=0.1, gamma=1e-5, tau=1e-6, data_kinds: [str] = None, replace=True
+    ):
         """Implementation of the standard Sparse Vector Technique (SVT) differential privacy algorithm.
 
         lambda_rho = gamma * 2.0 / epsilon
@@ -35,6 +37,8 @@
             noise_var (float, optional): additive noise. Defaults to 0.1.
             gamma (float, optional): Defaults to 1e-5.
             tau (float, optional): Defaults to 1e-6.
+            data_kinds (str, optional): Defaults to None.
+            replace (bool): whether to sample with replacement. Defaults to True.
         """
         if not data_kinds:
             data_kinds = [DataKind.WEIGHT_DIFF, DataKind.WEIGHTS]
@@ -47,6 +51,7 @@
         self.eps_3 = noise_var
         self.gamma = gamma
         self.tau = tau
+        self.replace = replace
 
     def process_dxo(self, dxo: DXO, shareable: Shareable, fl_ctx: FLContext) -> Union[None, DXO]:
         """Compute the differentially private SVT.
@@ -100,7 +105,7 @@
             accepted += candidate_idx[above_threshold].tolist()
             candidate_idx = candidate_idx[~above_threshold]
             self.log_info(fl_ctx, "selected {} responses, requested {}".format(len(accepted), n_upload))
-        accepted = np.random.choice(accepted, size=np.int64(n_upload))
+        accepted = np.random.choice(accepted, size=np.int64(n_upload), replace=self.replace)
         # eps_3 return with noise
         noise = np.random.laplace(scale=self.gamma * 2.0 / self.eps_3, size=accepted.shape)
         self.log_info(fl_ctx, "noise max: {}, median {}".format(np.max(np.abs(noise)), np.median(np.abs(noise))))

{"golden_diff": "diff --git a/nvflare/app_common/filters/svt_privacy.py b/nvflare/app_common/filters/svt_privacy.py\n--- a/nvflare/app_common/filters/svt_privacy.py\n+++ b/nvflare/app_common/filters/svt_privacy.py\n@@ -23,7 +23,9 @@\n \n \n class SVTPrivacy(DXOFilter):\n-    def __init__(self, fraction=0.1, epsilon=0.1, noise_var=0.1, gamma=1e-5, tau=1e-6, data_kinds: [str] = None):\n+    def __init__(\n+        self, fraction=0.1, epsilon=0.1, noise_var=0.1, gamma=1e-5, tau=1e-6, data_kinds: [str] = None, replace=True\n+    ):\n         \"\"\"Implementation of the standard Sparse Vector Technique (SVT) differential privacy algorithm.\n \n         lambda_rho = gamma * 2.0 / epsilon\n@@ -35,6 +37,8 @@\n             noise_var (float, optional): additive noise. Defaults to 0.1.\n             gamma (float, optional): Defaults to 1e-5.\n             tau (float, optional): Defaults to 1e-6.\n+            data_kinds (str, optional): Defaults to None.\n+            replace (bool): whether to sample with replacement. Defaults to True.\n         \"\"\"\n         if not data_kinds:\n             data_kinds = [DataKind.WEIGHT_DIFF, DataKind.WEIGHTS]\n@@ -47,6 +51,7 @@\n         self.eps_3 = noise_var\n         self.gamma = gamma\n         self.tau = tau\n+        self.replace = replace\n \n     def process_dxo(self, dxo: DXO, shareable: Shareable, fl_ctx: FLContext) -> Union[None, DXO]:\n         \"\"\"Compute the differentially private SVT.\n@@ -100,7 +105,7 @@\n             accepted += candidate_idx[above_threshold].tolist()\n             candidate_idx = candidate_idx[~above_threshold]\n             self.log_info(fl_ctx, \"selected {} responses, requested {}\".format(len(accepted), n_upload))\n-        accepted = np.random.choice(accepted, size=np.int64(n_upload))\n+        accepted = np.random.choice(accepted, size=np.int64(n_upload), replace=self.replace)\n         # eps_3 return with noise\n         noise = np.random.laplace(scale=self.gamma * 2.0 / self.eps_3, size=accepted.shape)\n         self.log_info(fl_ctx, \"noise max: {}, median {}\".format(np.max(np.abs(noise)), np.median(np.abs(noise))))\n", "issue": "Potential bug in SVT?\nHi all, \r\nis this intended that in [line 103](https://github.com/NVIDIA/NVFlare/blob/e5e8c15a3455c81cb16268fbaafeef3f26d2b195/nvflare/app_common/filters/svt_privacy.py#L103) of the SVTPrivacy class, only a random choice of the accepted parameters is taken with replacement? This will lead to a lower number of accepted and candidate parameters ([Line 108](https://github.com/NVIDIA/NVFlare/blob/e5e8c15a3455c81cb16268fbaafeef3f26d2b195/nvflare/app_common/filters/svt_privacy.py#L108)) than originally computed. \r\n\r\nSo even if I am running SVT it with a fraction of 1.0, not all of my noisy values (3.491.530) are transferred, but around 1.284.489 of them are set to 0. \r\n\n", "before_files": [{"content": "# Copyright (c) 2021-2022, NVIDIA CORPORATION.  All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom typing import Union\n\nimport numpy as np\n\nfrom nvflare.apis.dxo import DXO, DataKind, MetaKey\nfrom nvflare.apis.dxo_filter import DXOFilter\nfrom nvflare.apis.fl_context import FLContext\nfrom nvflare.apis.shareable import Shareable\n\n\nclass SVTPrivacy(DXOFilter):\n    def __init__(self, fraction=0.1, epsilon=0.1, noise_var=0.1, gamma=1e-5, tau=1e-6, data_kinds: [str] = None):\n        \"\"\"Implementation of the standard Sparse Vector Technique (SVT) differential privacy algorithm.\n\n        lambda_rho = gamma * 2.0 / epsilon\n        threshold = tau + np.random.laplace(scale=lambda_rho)\n\n        Args:\n            fraction (float, optional): used to determine dataset threshold. Defaults to 0.1.\n            epsilon (float, optional): Defaults to 0.1.\n            noise_var (float, optional): additive noise. Defaults to 0.1.\n            gamma (float, optional): Defaults to 1e-5.\n            tau (float, optional): Defaults to 1e-6.\n        \"\"\"\n        if not data_kinds:\n            data_kinds = [DataKind.WEIGHT_DIFF, DataKind.WEIGHTS]\n\n        super().__init__(supported_data_kinds=[DataKind.WEIGHTS, DataKind.WEIGHT_DIFF], data_kinds_to_filter=data_kinds)\n\n        self.frac = fraction  # fraction of the model to upload\n        self.eps_1 = epsilon\n        self.eps_2 = None  # to be derived from eps_1\n        self.eps_3 = noise_var\n        self.gamma = gamma\n        self.tau = tau\n\n    def process_dxo(self, dxo: DXO, shareable: Shareable, fl_ctx: FLContext) -> Union[None, DXO]:\n        \"\"\"Compute the differentially private SVT.\n\n        Args:\n            dxo: information from client\n            shareable: that the dxo belongs to\n            fl_ctx: context provided by workflow\n\n        Returns: filtered result.\n        \"\"\"\n        self.log_debug(fl_ctx, \"inside filter\")\n        model_diff = dxo.data\n        total_steps = dxo.get_meta_prop(MetaKey.NUM_STEPS_CURRENT_ROUND, 1)\n\n        delta_w = np.concatenate([model_diff[name].ravel() / np.float(total_steps) for name in sorted(model_diff)])\n        self.log_info(\n            fl_ctx,\n            \"Delta_w: Max abs: {}, Min abs: {}, Median abs: {}.\".format(\n                np.max(np.abs(delta_w)), np.min(np.abs(delta_w)), np.median(np.abs(delta_w))\n            ),\n        )\n\n        # precompute thresholds\n        n_upload = np.minimum(np.ceil(np.float(delta_w.size) * self.frac), np.float(delta_w.size))\n\n        # eps_1: threshold with noise\n        lambda_rho = self.gamma * 2.0 / self.eps_1\n        threshold = self.tau + np.random.laplace(scale=lambda_rho)\n        # eps_2: query with noise\n        self.eps_2 = self.eps_1 * (2.0 * n_upload) ** (2.0 / 3.0)\n        lambda_nu = self.gamma * 4.0 * n_upload / self.eps_2\n        self.logger.info(\n            \"total params: %s, epsilon: %s, \"\n            \"perparam budget %s, threshold tau: %s + f(eps_1) = %s, \"\n            \"clip gamma: %s\",\n            delta_w.size,\n            self.eps_1,\n            self.eps_1 / n_upload,\n            self.tau,\n            threshold,\n            self.gamma,\n        )\n\n        # selecting weights with additive noise\n        accepted, candidate_idx = [], np.arange(delta_w.size)\n        _clipped_w = np.abs(np.clip(delta_w, a_min=-self.gamma, a_max=self.gamma))\n        while len(accepted) < n_upload:\n            nu_i = np.random.laplace(scale=lambda_nu, size=candidate_idx.shape)\n            above_threshold = (_clipped_w[candidate_idx] + nu_i) >= threshold\n            accepted += candidate_idx[above_threshold].tolist()\n            candidate_idx = candidate_idx[~above_threshold]\n            self.log_info(fl_ctx, \"selected {} responses, requested {}\".format(len(accepted), n_upload))\n        accepted = np.random.choice(accepted, size=np.int64(n_upload))\n        # eps_3 return with noise\n        noise = np.random.laplace(scale=self.gamma * 2.0 / self.eps_3, size=accepted.shape)\n        self.log_info(fl_ctx, \"noise max: {}, median {}\".format(np.max(np.abs(noise)), np.median(np.abs(noise))))\n        delta_w[accepted] = np.clip(delta_w[accepted] + noise, a_min=-self.gamma, a_max=self.gamma)\n        candidate_idx = list(set(np.arange(delta_w.size)) - set(accepted))\n        delta_w[candidate_idx] = 0.0\n\n        # resume original format\n        dp_w, _start = {}, 0\n        for name in sorted(model_diff):\n            if np.ndim(model_diff[name]) == 0:\n                dp_w[name] = model_diff[name]\n                _start += 1\n                continue\n            value = delta_w[_start : (_start + model_diff[name].size)]\n            dp_w[name] = value.reshape(model_diff[name].shape) * np.float(total_steps)\n            _start += model_diff[name].size\n\n        # We update the shareable weights only.  Headers are unchanged.\n        dxo.data = dp_w\n        return dxo\n", "path": "nvflare/app_common/filters/svt_privacy.py"}], "after_files": [{"content": "# Copyright (c) 2021-2022, NVIDIA CORPORATION.  All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom typing import Union\n\nimport numpy as np\n\nfrom nvflare.apis.dxo import DXO, DataKind, MetaKey\nfrom nvflare.apis.dxo_filter import DXOFilter\nfrom nvflare.apis.fl_context import FLContext\nfrom nvflare.apis.shareable import Shareable\n\n\nclass SVTPrivacy(DXOFilter):\n    def __init__(\n        self, fraction=0.1, epsilon=0.1, noise_var=0.1, gamma=1e-5, tau=1e-6, data_kinds: [str] = None, replace=True\n    ):\n        \"\"\"Implementation of the standard Sparse Vector Technique (SVT) differential privacy algorithm.\n\n        lambda_rho = gamma * 2.0 / epsilon\n        threshold = tau + np.random.laplace(scale=lambda_rho)\n\n        Args:\n            fraction (float, optional): used to determine dataset threshold. Defaults to 0.1.\n            epsilon (float, optional): Defaults to 0.1.\n            noise_var (float, optional): additive noise. Defaults to 0.1.\n            gamma (float, optional): Defaults to 1e-5.\n            tau (float, optional): Defaults to 1e-6.\n            data_kinds (str, optional): Defaults to None.\n            replace (bool): whether to sample with replacement. Defaults to True.\n        \"\"\"\n        if not data_kinds:\n            data_kinds = [DataKind.WEIGHT_DIFF, DataKind.WEIGHTS]\n\n        super().__init__(supported_data_kinds=[DataKind.WEIGHTS, DataKind.WEIGHT_DIFF], data_kinds_to_filter=data_kinds)\n\n        self.frac = fraction  # fraction of the model to upload\n        self.eps_1 = epsilon\n        self.eps_2 = None  # to be derived from eps_1\n        self.eps_3 = noise_var\n        self.gamma = gamma\n        self.tau = tau\n        self.replace = replace\n\n    def process_dxo(self, dxo: DXO, shareable: Shareable, fl_ctx: FLContext) -> Union[None, DXO]:\n        \"\"\"Compute the differentially private SVT.\n\n        Args:\n            dxo: information from client\n            shareable: that the dxo belongs to\n            fl_ctx: context provided by workflow\n\n        Returns: filtered result.\n        \"\"\"\n        self.log_debug(fl_ctx, \"inside filter\")\n        model_diff = dxo.data\n        total_steps = dxo.get_meta_prop(MetaKey.NUM_STEPS_CURRENT_ROUND, 1)\n\n        delta_w = np.concatenate([model_diff[name].ravel() / np.float(total_steps) for name in sorted(model_diff)])\n        self.log_info(\n            fl_ctx,\n            \"Delta_w: Max abs: {}, Min abs: {}, Median abs: {}.\".format(\n                np.max(np.abs(delta_w)), np.min(np.abs(delta_w)), np.median(np.abs(delta_w))\n            ),\n        )\n\n        # precompute thresholds\n        n_upload = np.minimum(np.ceil(np.float(delta_w.size) * self.frac), np.float(delta_w.size))\n\n        # eps_1: threshold with noise\n        lambda_rho = self.gamma * 2.0 / self.eps_1\n        threshold = self.tau + np.random.laplace(scale=lambda_rho)\n        # eps_2: query with noise\n        self.eps_2 = self.eps_1 * (2.0 * n_upload) ** (2.0 / 3.0)\n        lambda_nu = self.gamma * 4.0 * n_upload / self.eps_2\n        self.logger.info(\n            \"total params: %s, epsilon: %s, \"\n            \"perparam budget %s, threshold tau: %s + f(eps_1) = %s, \"\n            \"clip gamma: %s\",\n            delta_w.size,\n            self.eps_1,\n            self.eps_1 / n_upload,\n            self.tau,\n            threshold,\n            self.gamma,\n        )\n\n        # selecting weights with additive noise\n        accepted, candidate_idx = [], np.arange(delta_w.size)\n        _clipped_w = np.abs(np.clip(delta_w, a_min=-self.gamma, a_max=self.gamma))\n        while len(accepted) < n_upload:\n            nu_i = np.random.laplace(scale=lambda_nu, size=candidate_idx.shape)\n            above_threshold = (_clipped_w[candidate_idx] + nu_i) >= threshold\n            accepted += candidate_idx[above_threshold].tolist()\n            candidate_idx = candidate_idx[~above_threshold]\n            self.log_info(fl_ctx, \"selected {} responses, requested {}\".format(len(accepted), n_upload))\n        accepted = np.random.choice(accepted, size=np.int64(n_upload), replace=self.replace)\n        # eps_3 return with noise\n        noise = np.random.laplace(scale=self.gamma * 2.0 / self.eps_3, size=accepted.shape)\n        self.log_info(fl_ctx, \"noise max: {}, median {}\".format(np.max(np.abs(noise)), np.median(np.abs(noise))))\n        delta_w[accepted] = np.clip(delta_w[accepted] + noise, a_min=-self.gamma, a_max=self.gamma)\n        candidate_idx = list(set(np.arange(delta_w.size)) - set(accepted))\n        delta_w[candidate_idx] = 0.0\n\n        # resume original format\n        dp_w, _start = {}, 0\n        for name in sorted(model_diff):\n            if np.ndim(model_diff[name]) == 0:\n                dp_w[name] = model_diff[name]\n                _start += 1\n                continue\n            value = delta_w[_start : (_start + model_diff[name].size)]\n            dp_w[name] = value.reshape(model_diff[name].shape) * np.float(total_steps)\n            _start += model_diff[name].size\n\n        # We update the shareable weights only.  Headers are unchanged.\n        dxo.data = dp_w\n        return dxo\n", "path": "nvflare/app_common/filters/svt_privacy.py"}]}