apple / apple/coremltools

PReLU rank 3 or rank 5 input requires all values of alpha to be the same?

Open
#2,002 3 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
5.4k
Forks
850
Avg merge
4d 5h
Merged PRs (30d)
10

Description

## ❓Question

Hi, I was trying to convert a traced PyTorch model with a `PReLU` module and one of its components looks like this:
```py
Block(
(conv1): Conv1d(1, 32, kernel_size=(5,), stride=(1,), bias=False)
(bn): BatchNorm1d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): PReLU(num_parameters=32)
(res): Conv1d(1, 32, kernel_size=(1,), stride=(1,), bias=False)
)
```

When I convert the model though, I get this error:
```py
ValueError: prelu op: rank 3 or rank 5 input is only supported when all the values of alpha are same,which is not the case here
```

I patched out the check locally and it allows the model to successfully export and perform an inference run too, though I haven't checked if it yields legible output.

Is there documentation on why this restriction is in place?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.