Skip to content

Commit 54f4e3c

Browse files
kevalmorabia97graeb
andcommitted
Fix onnx ptq image prep script for fp16 (#168)
Co-Authored-By: graeb <[email protected]>
1 parent 7b462dd commit 54f4e3c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/onnx_ptq/image_prep.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def main():
5050
calib_tensor.append(transforms(image))
5151

5252
calib_tensor = np.stack(calib_tensor, axis=0)
53+
if args.fp16:
54+
calib_tensor = calib_tensor.astype(np.float16) # type: ignore[attr-defined]
5355
np.save(args.output_path, calib_tensor)
5456

5557

0 commit comments

Comments
 (0)