Torch.tensor([1.0,2.0,3.0]) in scripted function

Hi
Is there a way to create torch tensor from python list or tuple in a scripted function?
I got this if i try ;
unknown builtin op:
@torch.jit.script
def test_func(x):
y=torch.tensor([1.0,2.0,3.0])
~~~~~~~~~~~~ <— HERE
return x+y

with pytorch version '1.0.0a0+b039a71 build from sources:
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
[GCC 7.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import torch
torch.version
‘1.0.0a0+b039a71’

Thanks

Hi,

I think this has been added to master here.

Thanks for the reply
it’s brand new because i compile the lib from sources the 11 of december.
i guess i have to recompile it…

Yes this was merged 13h ago :slight_smile:

Hi again
In fact the commit has been reverted 11h ago…
I check it because i download and compile with the latest source but i still have a error with torch.tensor…

Hi,
This feature seems not ready yet. I’m using daily build of 1.0.0.dev20190101.