Issue
I have a class that accepts a parameter X. This parameter X is a numpy array, containing lists that contain ints.
array([[ 101, 2002, 8542, ..., 0, 0, 0],
[ 101, 2002, 8974, ..., 0, 0, 0],
[ 101, 5076, 2743, ..., 0, 0, 0],
...,
[ 101, 4302, 2253, ..., 0, 0, 0],
[ 101, 13875, 2003, ..., 0, 0, 0],
[ 101, 1045, 2031, ..., 0, 0, 0]])
I have a class that takes this X and assigns it to an attribute.
class TaskADataset(Dataset):
def __init__(self, X, y):
self.X = X,
self.y = y
But the parameter X and the attribute X now have different lengths.
dataset = TaskADataset(X, y)
print(len(dataset.X), len(X))
1 10000
Why is this occurring? Thank you for the help.
Solution
As shriakhilc pointed out, I included a "," and this turned it into a tuple with one element.
Answered By - Null Pointer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.