Here’s the approach I ended up taking.
def forward(self, x):
        """
        Args:
            x: (tensor) sizedtorch.Size([32, 225])
        """
        x = F.leaky_relu(self.fc1(x)) # [32, 225]

        for i in range(len(x[:,])):
            s = x[i, :] # [1, 225]
            s = s * self.phi() # initialized to ones [1, 225]
            s = get_top_k(s, 10, mask_type="binary")
            self.phi.update(s, 0.1618)
            x[i, :] = s 
            # print(x[i, :])   
        return x