-
Story
-
Resolution: Done
-
Undefined
-
None
-
None
-
None
-
3
-
False
-
-
False
-
-
-
PyTorch Sprint 18, PyTorch Sprint 19, PyTorch Sprint 20, PyTorch Sprint 21, PyTorch Sprint 22
-
-
- 🐛 Describe the bug
-
Setting the float value `3.` to `input_size` of [nn.RNN()](https://pytorch.org/docs/stable/generated/torch.nn.RNN.html) gets the indirect error message as shown below:
```python
import torch
from torch import nn
my_tensor = torch.tensor([[8., -3., 5.]])
torch.manual_seed(42)
- ↓↓
rnn = nn.RNN(input_size=3., hidden_size=2) # Error
rnn(input=my_tensor)
```
> TypeError: empty(): argument 'size' failed to unpack the object at pos 2 with error "type must be tuple of ints,but got float"
And, setting the boolean value `True` to `input_size` of `nn.RNN()` gets the indirect error message as shown below:
```python
import torch
from torch import nn
my_tensor = torch.tensor([[8., -3., 5.]])
torch.manual_seed(42)
- ↓↓↓↓
rnn = nn.RNN(input_size=True, hidden_size=2)
rnn(input=my_tensor) # Error
```
> RuntimeError: input.size(-1) must be equal to input_size. Expected True, got 3
So, the error messages should be something direct like as shown below:
> TypeError: `input_size` argument must be `int` but got `float`
> TypeError: `input_size` argument must be `int` but got `bool`
-
-
- Versions
-
```python
import torch
torch._version_ # '2.3.0'
```
cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki
- clones
-
AIPCC-6334 nn.CrossEntropyLoss overflow with FP16 and minibatch
-
- Review
-
- is cloned by
-
AIPCC-6698 The error message of `nn.RNN()` for the input tensor should say ValueError: the dtype of the `input` tensor and `RNN()` must be the same but got `...` and `...` respectively
-
- Closed
-
-
AIPCC-6644 torch.nansum does not work with complex numbers on CPU
-
- To Do
-
- mentioned on