For example, I have data with features features in an n x m1 x m2 tensor, and a modelthat I’m using to transform the input features by putting it through the model


class model(nn.Module):
    def __init__(self):
        super(model, self).__init__()
        ...

    def forward(self, x):
        ...
        return x

model = model()

However due to the size of the data, I get a cuda out of memory error if I just do
new_features = model(features)

So I want to process the data in batches using a DataLoader, but what should I do after making the batch predictions to get the new_features as an n x m1 x m2 tensor?