Skip to content

Commit

Permalink
export qonnx
Browse files Browse the repository at this point in the history
  • Loading branch information
mmrahorovic committed Feb 22, 2024
1 parent 5b5a894 commit cf2e3af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build/cybersecurity-mlp/custom_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
from qonnx.core.modelwrapper import ModelWrapper
from qonnx.core.datatype import DataType


# Define export wrapper
class CybSecMLPForExport(nn.Module):
def __init__(self, my_pretrained_model):
Expand Down Expand Up @@ -109,7 +108,9 @@ def custom_step_mlp_export(model_name):
input_t = torch.from_numpy(input_a * scale)

# Export to ONNX
bo.export_finn_onnx(model_for_export, export_path=ready_model_filename, input_t=input_qt)
bo.export_qonnx(
model_for_export, export_path=ready_model_filename, input_t=input_t
)

# Set input datatype for FINN's InferDataType transformation to infer the right datatypes
model = ModelWrapper(ready_model_filename)
Expand Down

0 comments on commit cf2e3af

Please sign in to comment.