I don’t think it is in the plans to provide any functionality like that, because it depends on the input size, and pytorch has dynamic graphs so you don’t compile your graph beforehand.
But, there are workarounds for that.
Check for example Inferring shape via flatten operator