Skip to content

Commit c4a8c62

Browse files
committed
Fix imports of profiling module
1 parent c62193d commit c4a8c62

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

part2_advanced_config.ipynb

+5-3
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,14 @@
118118
"outputs": [],
119119
"source": [
120120
"%matplotlib inline\n",
121+
"from hls4ml.model.profiling import numerical, get_ymodel_keras\n",
122+
"\n",
121123
"for layer in config['LayerName'].keys():\n",
122124
" config['LayerName'][layer]['Trace'] = True\n",
123125
"hls_model = hls4ml.converters.convert_from_keras_model(\n",
124126
" model, hls_config=config, output_dir='model_1/hls4ml_prj_2', part='xcu250-figd2104-2L-e'\n",
125127
")\n",
126-
"hls4ml.model.profiling.numerical(model=model, hls_model=hls_model, X=X_test[:1000])"
128+
"numerical(model=model, hls_model=hls_model, X=X_test[:1000])"
127129
]
128130
},
129131
{
@@ -146,7 +148,7 @@
146148
"hls_model = hls4ml.converters.convert_from_keras_model(\n",
147149
" model, hls_config=config, output_dir='model_1/hls4ml_prj_2', part='xcu250-figd2104-2L-e'\n",
148150
")\n",
149-
"hls4ml.model.profiling.numerical(model=model, hls_model=hls_model)\n",
151+
"numerical(model=model, hls_model=hls_model)\n",
150152
"hls4ml.utils.plot_model(hls_model, show_shapes=True, show_precision=True, to_file=None)"
151153
]
152154
},
@@ -190,7 +192,7 @@
190192
"source": [
191193
"hls_model.compile()\n",
192194
"hls4ml_pred, hls4ml_trace = hls_model.trace(X_test[:1000])\n",
193-
"keras_trace = hls4ml.model.profiling.get_ymodel_keras(model, X_test[:1000])\n",
195+
"keras_trace = get_ymodel_keras(model, X_test[:1000])\n",
194196
"y_hls = hls_model.predict(X_test)"
195197
]
196198
},

part6_cnns.ipynb

+3-2
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,8 @@
714714
"metadata": {},
715715
"outputs": [],
716716
"source": [
717-
"hls4ml.model.profiling.numerical(model=model, hls_model=hls_model)"
717+
"from hls4ml.model.profiling import numerical\n",
718+
"numerical(model=model, hls_model=hls_model)"
718719
]
719720
},
720721
{
@@ -767,7 +768,7 @@
767768
"metadata": {},
768769
"outputs": [],
769770
"source": [
770-
"hls4ml.model.profiling.numerical(model=qmodel, hls_model=hls_model_q)\n",
771+
"numerical(model=qmodel, hls_model=hls_model_q)\n",
771772
"hls4ml.utils.plot_model(hls_model_q, show_shapes=True, show_precision=True, to_file=None)"
772773
]
773774
},

0 commit comments

Comments
 (0)