Hi
This can be done but it’ll depend on the network’s architecture, so for example for a simple network with 1 nn.Linear layer. Both the batch dimensions are outputted. For example,
>>> x = torch.randn(4,5,64)
>>> fc = torch.nn.Linear(64, 1)
>>> y = fc(x)
>>> y.shape #torch.Size([4, 5, 1])

Can you share some more about the model?