expand(torch.DoubleTensor{[999]}, size=[]): the number of sizes provided (0) must be greater or equal to the number of dimensions in the tensor (1)

I get this with Python3.6, Pytorch 0.4.1 on a Mac.

I’ve tried looking at every issue and Google result. There aren’t really any solutions. that weren’t related to bugs in previous versions. Can someone help me here?

Here’s the line of code raising this:

self.state[next_index] = torch.from_numpy(col_data)

also tried:
self.state[next_index] = torch.tensor(col_data)

Exact error: RuntimeError: expand(torch.DoubleTensor{[999]}, size=[]): the number of sizes provided (0) must be greater or equal to the number of dimensions in the tensor (1)

Could you print some values of col_data and its shape as well as some info about self.state?
I’m not sure what this error means regarding your code sample.

Sure, yeah.

col_data is shape (999,) and looks like this

self.state is just self.state = torch.FloatTensor(torch.zeros(110))

It looks like you would like to insert col_data at a specific index in state.
Could you create state as state = torch.zeros(110, 999) and try it again?

Ah yeah, I get it now, thanks.