Solved by ptrblck in post #4 
              
              
                Sure! 
This code snippet would work for a batch size of 2. 
Note that I assume you are using a constant number of selected features in each batch (in this case 3 features). 
class MyModel(nn.Module):
    def __init__(self):
        super(MyModel, self).__init__()
        self.conv1 = nn.Conv2d(1, 5,…