Skip to content

Commit 5ec357b

Browse files
committed
Fix the incompatible with PEP8
Signed-off-by: nhhung1810 <[email protected]>
1 parent 292b5a5 commit 5ec357b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

modules/network_contraints/unet_plusplus.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,21 +230,21 @@
230230
"\n",
231231
"\n",
232232
"def test_min_dim():\n",
233-
" MIN_EDGE = 16\n",
234-
" batch_size, spatial_dim, H, W = 1, 3, MIN_EDGE, MIN_EDGE\n",
235-
" MODEL_BY_NORM_LAYER: Dict[str, BasicUnetPlusPlus] = {}\n",
233+
" min_edge = 16\n",
234+
" batch_size, spatial_dim, height, width = 1, 3, min_edge, min_edge\n",
235+
" model_dict: Dict[str, BasicUnetPlusPlus] = {}\n",
236236
" print(\"Prepare model\")\n",
237237
" for norm_layer in [\"instance\", \"batch\"]:\n",
238-
" MODEL_BY_NORM_LAYER[norm_layer] = make_model_with_layer(norm_layer)\n",
238+
" model_dict[norm_layer] = make_model_with_layer(norm_layer)\n",
239239
"\n",
240240
" # print(f\"Input dimension {(batch_size, spatial_dim, H, W)} that will cause error\")\n",
241241
" for norm_layer in [\"instance\", \"batch\"]:\n",
242242
" print(\"=\" * 10 + f\" USING NORM LAYER: {norm_layer.upper()} \" + \"=\" * 10)\n",
243-
" model = MODEL_BY_NORM_LAYER[norm_layer]\n",
243+
" model = model_dict[norm_layer]\n",
244244
" print(\"_\" * 10 + \" Changing the H dimension of 2D input \" + \"_\" * 10)\n",
245-
" for _H_temp in [H, H * 2]:\n",
245+
" for temp_height in [height, height * 2]:\n",
246246
" try:\n",
247-
" x = torch.ones(batch_size, spatial_dim, _H_temp, W)\n",
247+
" x = torch.ones(batch_size, spatial_dim, temp_height, width)\n",
248248
" print(f\">> Using Input.shape={x.shape}\")\n",
249249
" model(x)\n",
250250
" except Exception as msg:\n",
@@ -254,7 +254,7 @@
254254
" print(\"_\" * 10 + \" Changing the batch size \" + \"_\" * 10)\n",
255255
" for batch_size_tmp in [1, 2]:\n",
256256
" try:\n",
257-
" x = torch.ones(batch_size_tmp, spatial_dim, H, W)\n",
257+
" x = torch.ones(batch_size_tmp, spatial_dim, height, width)\n",
258258
" print(f\">> Input.shape={x.shape}\")\n",
259259
" model(x)\n",
260260
" except Exception as msg:\n",

0 commit comments

Comments
 (0)