shape inference of undefined for prim::grad (#40866)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/40866
Reviewed By: pbelevich
Differential Revision: D22358988
Pulled By: Krovatkin
fbshipit-source-id: 7118d7f8d4eaf056cfb71dc0d588d38b1dfb0fc7