twitter-archive / torch-dataset

An extensible and high performance method of reading, sampling and processing data for Torch
Apache License 2.0
76 stars 24 forks source link

A bug may exist when tensors is the input to Dataset #20

Closed jundengdeng closed 8 years ago

jundengdeng commented 8 years ago

There may be a small bug when tensors is the input to Dataset. The following code should work if I didn't misunderstand the code. But it didn't work as expected.

DS = require 'dataset.Dataset'
dataset = DS({x=torch.randn(100, 9),y=torch.randn(100)})
print(dataset.index)

If the code above is corrected as follows, then it works.

DS = require 'dataset.Dataset'
dataset = DS({{x=torch.randn(100, 9),y=torch.randn(100)}})
print(dataset.index)

Could you please correct the bug? Thanks!

Jun

zakattacktwitter commented 8 years ago

Thanks for reporting this, it should be fixed now.