Click4Ai

561.

Medium

### Problem: ONNX Model Export

You are given a trained neural network model and want to export it to ONNX format for deployment on different platforms. Write a function that takes the model and its input shape as input and exports it to ONNX format.

#### Example:

Suppose we have a trained neural network model model and its input shape is (1, 28, 28). We can use the function to export the model to ONNX format as follows:

model = ... # load the trained model

input_shape = (1, 28, 28)

export_model(model, input_shape)

Test Cases

Test Case 1
Input: [1, 28, 28]
Expected: model.onnx
Test Case 2
Input: [2, 28, 28]
Expected: model.onnx
+ 3 hidden test cases