Doesn’t work for me in version 0.5.0a0+e62c3a4 throwing the following error:
RuntimeError: torch/csrc/autograd/generated/VariableType.cpp:27992: transpose: Assertion `jit::tracer::ArgumentStash::empty()` failed.

from grid = F.affine_grid(theta, x.size()).