How to find number of features in .pth file

Hi, I am new to pytorch.
I have 123.pth features file.
I have determined its size and it output “torch.Size([1, 2048, 25, 19])”
I want to know how many features(region/grid) this file has. Do I need to multiply 25*19 and answer would be the number of features?

It depends on the tensor and how you would define “features”.
Based on the tensor shape it could be an intermediate activation in the shape [batch_size, channels, height, width].
If you are flattening it and passing to e.g. a linear layers, the usual approach would be to use: x = x.view(x.size(0), -1), which would result in 2048*25*19=972800 “features”.

@ptrblck thank you for your response. The paper that these features belongs to, says the number of features are from (100-608) depending upon the size of image. It means that they are counting height*width? I’d like to minimize the number of features to 36 (i-e using clustering). That’s why I am asking if I could make these features to 36 using h*w?