Hi,all,I have some problem about ONNX Prelu.I convert my pytorch model to onnx ,but got error:
In `main`:
#[version = "0.0.5"]
fn (%inputL: Tensor[(1, 3, 512, 960), float32], %feature_extraction.firstconv.conv1.0.0.weight: Tensor[(48, 3, 1, 1), float32], %feature_extraction.firstconv.conv1.0.1.weight: Tensor[(48), float32], %feature_extraction.firstconv.conv1.0.1.bias: Tensor[(48), float32], %feature_extraction.firstconv.conv1.0.1.running_mean: Tensor[(48), float32], %feature_extraction.firstconv.conv1.0.1.running_var: Tensor[(48), float32], %v1552: Tensor[(1, 1, 1), float32]) {
%0 = nn.conv2d(%inputL, %feature_extraction.firstconv.conv1.0.0.weight, padding=[0, 0, 0, 0], kernel_size=[1, 1]);
%1 = nn.batch_norm(%0, %feature_extraction.firstconv.conv1.0.1.weight, %feature_extraction.firstconv.conv1.0.1.bias, %feature_extraction.firstconv.conv1.0.1.running_mean, %feature_extraction.firstconv.conv1.0.1.running_var);
%2 = %1.0;
%3 = reshape(%v1552, newshape=[-1]);
nn.prelu(%2, %3) in particular dimension 0 conflicts 48 does not match 1; unable to unify: Tensor[(48), float32]` and `Tensor[(1), float32]`;
I have read the doc about prelu:
PRelu
PRelu takes input data (Tensor) and slope tensor as input, and produces one output data (Tensor) where the function
f(x) = slope * x for x < 0
,f(x) = x for x >= 0
., is applied to the data tensor elementwise. This operator supports unidirectional broadcasting (tensor slope should be unidirectional broadcastable to input tensor X); for more details please check the doc.Version
This version of the operator has been available since version 9 of the default ONNX operator set.
Other versions of this operator: 1, 6, 7
Inputs
X : T
Input tensor
slope : T
Slope tensor. The shape of slope can be smaller then first input X; if so, its shape must be unidirectional broadcastable to X
Outputs
Y : T
Output tensor (same size as X)
my model have the prelu op,the slope shape is (1,1,1) the Input tensor shape is (1,48,512,960) Maybe tvm prelu can not support broadcast?
Thanks!