Closed carmocca closed 2 years ago
__getitem__
need to return an object (Tuple, ndarray, list...) such that it is indexable and has a length equal to the number of fields specified in the DatasetWriter so that each field can be associated with the corresponding data. Here you have 1 field so, the length should be 1 but
self.X[idx].astype('float32')
has a length of d
so it won't work as the first dimension (d
) will be interpreted as the field
dimension.
The cause is that
NDArrayField
requires that the output of__getitem__
is a tuple:resolves the issue.
Is this a bug or a hard-requirement?