Skip to content

Commit 6d650ef

Browse files
fix pep8
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
1 parent 82daa32 commit 6d650ef

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

acceleration/fast_inference_tutorial/fast_inference_tutorial.ipynb

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,8 @@
4242
"cell_type": "markdown",
4343
"metadata": {},
4444
"source": [
45-
"## Install environment"
46-
]
47-
},
48-
{
49-
"cell_type": "markdown",
50-
"metadata": {},
51-
"source": [
45+
"## Setup environment\n",
46+
"\n",
5247
"Loading data directly from disk to GPU memory requires the `kvikio` library. In addition, this tutorial requires many other dependencies such as `monai`, `torch`, `torch_tensorrt`, `numpy`, `ignite`, `pandas`, `matplotlib`, etc. We recommend using the [MONAI Docker](https://docs.monai.io/en/latest/installation.html#from-dockerhub) image to run this tutorial, which includes pre-configured dependencies and allows you to skip manual installation.\n",
5348
"\n",
5449
"If not using MONAI Docker, install `kvikio` using one of these methods:\n",
@@ -113,10 +108,10 @@
113108
"from monai.inferers import sliding_window_inference\n",
114109
"from monai.networks.nets import SegResNet\n",
115110
"import matplotlib.pyplot as plt\n",
116-
"import torch\n",
117111
"import gc\n",
118112
"import pandas as pd\n",
119113
"from timeit import default_timer as timer\n",
114+
"from utils import prepare_test_datalist, prepare_model_weights, prepare_tensorrt_model\n",
120115
"\n",
121116
"print_config()"
122117
]
@@ -284,8 +279,6 @@
284279
}
285280
],
286281
"source": [
287-
"from utils import prepare_test_datalist, prepare_model_weights, prepare_tensorrt_model\n",
288-
"\n",
289282
"root_dir = \".\"\n",
290283
"torch.backends.cudnn.benchmark = True\n",
291284
"torch_tensorrt.runtime.set_multi_device_safe_mode(True)\n",
@@ -465,7 +458,7 @@
465458
"outputs": [],
466459
"source": [
467460
"# collect benchmark results\n",
468-
"all_df = pd.read_csv(os.path.join(root_dir, f\"time_original.csv\"))\n",
461+
"all_df = pd.read_csv(os.path.join(root_dir, \"time_original.csv\"))\n",
469462
"all_df.columns = [\"file_name\", \"original_time\"]\n",
470463
"\n",
471464
"for benchmark_type in [\"trt\", \"trt_gpu_transforms\", \"trt_gds_gpu_transforms\"]:\n",

0 commit comments

Comments
 (0)