onnx reshape
时间: 2023-08-22 20:10:54 浏览: 181
ONNX (Open Neural Network Exchange) is an open format for representing deep learning models. The reshape operation in ONNX allows you to change the shape of the input tensor without changing its data. Reshaping can be helpful in various scenarios, such as adjusting the dimensions of the input tensor to match the expected input shape of a model.
To perform reshape in ONNX, you can use the Reshape node. The Reshape node takes two inputs: the input tensor and the desired shape. The desired shape is a 1D tensor that specifies the new shape of the input tensor. The Reshape node then reshapes the input tensor accordingly.
Here is an example of how you can use reshape in ONNX:
```
import numpy as np
import onnx
阅读全文