Hello!
Is there some utility function hidden somewhere for calculating the shape of the output tensor that would result from passing a given input tensor to (for example), a nn.Conv2d module?
To me this seems basic though, so I may be misunderstanding something about how pytorch is supposed to be used.
Use case:
You have a (non-convolutional) custom module that needs to know the shape of its input in order to define its nn.Parameters. I realize fully-convolutional architectures do not have this need, but I have a module that does. Your code is built so that the Variable passed to this module is the result of applying a Conv2d module to a tensor of known (constant) size. Given all the arguments to the Conv2d module (stride, kernel size, etc), the size of the output can be computed, but to my knowledge this function isn’t in pytorch.
Is this function just not in pytorch? (In which case I can implement it, for personal use, or submission) Or is my question based on a false premise?