Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple conversions from tensor to np.array #5

Open
iffsid opened this issue Feb 1, 2017 · 0 comments
Open

Multiple conversions from tensor to np.array #5

iffsid opened this issue Feb 1, 2017 · 0 comments

Comments

@iffsid
Copy link

iffsid commented Feb 1, 2017

There appears to be an error triggered when passing the same tensor through to python.

For instance, this bit of code

lp = require('lpython')
pd = lp.import('pandas')

b = torch.Tensor({{1,2,3},{4.1,5,6}})
c = torch.cdiv(b, b:sum(2):expandAs(b)):mul(100)

df = pd.DataFrame(c)
df2 = pd.DataFrame(c)

creates the error

Trying to create an array from an unresizable tensor. Abording.
[string "dfcm = pd.DataFrame(c)"]:1: failed to convert argument #1
stack traceback:
	[C]: in function 'DataFrame'
	[string "dfcm = pd.DataFrame(c)"]:1: in main chunk
	[C]: in function 'xpcall'
	/home/nsid/torch/share/lua/5.1/trepl/init.lua:679: in function 'repl'
	/home/nsid/torch/lib/luarocks/rocks/trepl/scm-1/bin/th:204: in main chunk
	[C]: at 0x00405de0	
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant