Hi,
if you indeed have an X_array, for many use-cases (where the items have same size), you can just glue your enumeration dimension with the batch dimension using .view:
y = MySubClass(X_Array.view((X_Array.size(0)*X_Array.size(1),X_Array.size(2)))
return y.view(X_Array.size(0), X_Array.size(1),y.size(2))

or so.
Of course, if the items are all of different shapes, that won’t work.
Best regards
Thomas