In PyTorch 1.6.0.dev20200518, BroadcastingListN[int] returns a List[float] in torchscript, instead of a List[int].
In [1]: import torch; from torch.jit.annotations import BroadcastingList2
In [2]: def f(x: BroadcastingList2[int]):
...: return x
...:
In [3]: ff = torch.jit.script(f)
In [4]: ff(1)
Out[4]: [1.0, 1.0]
In [5]: torch.__version__
Out[5]: '1.6.0.dev20200518'
It doesn't look like it is desired behavior? What is weird is that the underlying representation seems correct on its return type
In [6]: print(ff.code)
def f(x: List[int]) -> List[int]:
return x
cc @suo
In PyTorch 1.6.0.dev20200518,
BroadcastingListN[int]returns aList[float]in torchscript, instead of aList[int].It doesn't look like it is desired behavior? What is weird is that the underlying representation seems correct on its return type
cc @suo