Why the input of AvgPool3d must be variable but MaxPool3d can support tensor?

Which PyTorch version are you using?
Variables are deprecated since 0.4.0, so this error message shouldn’t be raised anymore.